if ($_POST) {$content = stripslashes($_POST['content']);
$by = $_SESSION['exp_user']['username'];
$dt = date("F j, Y, g:i a");
mysql_query("UPDATE tbl_intmsg SET time = ".$dt.", by = ".$by." AND content = ".$content."") or die(mysql_error());
对于我收到错误:PHP + MySQL错误
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '26, 2009, 2:28 pm, by = shamil.nunhuck AND content = Test message! ' at line 1
任何想法?
象这样的错误是更容易,如果你检查结果的SQL字符串,而不是产生该字符串的代码来解决。 – 2009-05-30 21:05:42