Jump to content

Has problem for update database


xbl1

Recommended Posts

Hi;I am trying to update my database, but the problem for me is the old value replace with the value of the " " (empty). my code as following;$subject=$_POST['subject'];$content=$_POST['content'];echo $subject;echo $content;$result=mysql_query("UPDATE Thread SET Subject='$subject', Content='$content' where Id='$threadId'");there are not problem for the "echo $subject" and "echo $content;"but if rewrite as following, it does update the values from database.$result=mysql_query("UPDATE Thread SET Subject='subject', Content='content' where Id='$threadId'");

Link to comment
Share on other sites

What Synook said, just do it after the query, or usually you stop execution(mysql_query('blah') OR die(mysql_error());, for example).If you don't have any errors, you may want to echo out the string itself to see if there are any issues in the words, or if you need to use mysql_real_escape_string.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...