grlayouts Posted September 24, 2006 Share Posted September 24, 2006 ok i have a script that should update whats wrote in the box and update it into the database, its gonna be something stupid but what i have is,[code] if ($view == loginnews) { print "<form method=post action=admin.php?view=loginnews&step=add>News: <input type=text name=message> <input type=submit value=Add></form>"; if ($step == Add) {mysql_fetch_row(mysql_query("SELECT loginmsg FROM messages WHERE message='message';"))){mysql_query("INSERT INTO messages VALUES ('$message','message');");}else{ mysql_query("UPDATE messages SET loginmsg=$message WHERE message='message'");}[/code]see the problem? Link to comment https://forums.phpfreaks.com/topic/21897-cant-see-why/ Share on other sites More sharing options...
trq Posted September 24, 2006 Share Posted September 24, 2006 First guess would be...[code=php:0]if ($view == loginnews) {[/code]Should be...[code=php:0]if ($view == "loginnews") {[/code] Link to comment https://forums.phpfreaks.com/topic/21897-cant-see-why/#findComment-97829 Share on other sites More sharing options...
grlayouts Posted September 24, 2006 Author Share Posted September 24, 2006 no that all works its the writing to the data base that doesnt. Link to comment https://forums.phpfreaks.com/topic/21897-cant-see-why/#findComment-97842 Share on other sites More sharing options...
trq Posted September 25, 2006 Share Posted September 25, 2006 So you have defined the constant [i]loginnews[/i]? Can we see where? Link to comment https://forums.phpfreaks.com/topic/21897-cant-see-why/#findComment-97853 Share on other sites More sharing options...
neylitalo Posted September 25, 2006 Share Posted September 25, 2006 golly gee gosh almighty, that's the messiest code I have ever seen. Clean it up a bit so we don't have to decipher it. Link to comment https://forums.phpfreaks.com/topic/21897-cant-see-why/#findComment-97856 Share on other sites More sharing options...
grlayouts Posted September 25, 2006 Author Share Posted September 25, 2006 if you think thats messy you should see the whole game. lol Link to comment https://forums.phpfreaks.com/topic/21897-cant-see-why/#findComment-98593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.