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? Quote Link to comment 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] Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.