Jump to content


Photo

cant see why...


  • Please log in to reply
5 replies to this topic

#1 grlayouts

grlayouts
  • Members
  • PipPipPip
  • Advanced Member
  • 342 posts

Posted 24 September 2006 - 10:35 PM

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,

       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'");}

see the problem?

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 September 2006 - 11:08 PM

First guess would be...

if ($view == loginnews) {

Should be...

if ($view == "loginnews") {


#3 grlayouts

grlayouts
  • Members
  • PipPipPip
  • Advanced Member
  • 342 posts

Posted 24 September 2006 - 11:56 PM

no that all works its the writing to the data base that doesnt.

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 September 2006 - 12:32 AM

So you have defined the constant loginnews? Can we see where?

#5 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 25 September 2006 - 12:37 AM

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.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#6 grlayouts

grlayouts
  • Members
  • PipPipPip
  • Advanced Member
  • 342 posts

Posted 25 September 2006 - 10:41 PM

if you think thats messy you should see the whole game. lol




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users