Jump to content

Archived

This topic is now archived and is closed to further replies.

grlayouts

cant see why...

Recommended Posts

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?

Share this post


Link to post
Share on other sites
First guess would be...

[code=php:0]
if ($view == loginnews) {
[/code]

Should be...

[code=php:0]
if ($view == "loginnews") {
[/code]

Share this post


Link to post
Share on other sites
So you have defined the constant [i]loginnews[/i]? Can we see where?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.