7 回答

TA貢獻(xiàn)2條經(jīng)驗(yàn) 獲得超0個(gè)贊
SQL語句改下?$update_sql = "UPDATE guestbook SET reply = '".$reply."', replytime = $replytime WHERE id = $_POST[id]";
單引號(hào)不解析php變量,被當(dāng)做字符串了

TA貢獻(xiàn)50條經(jīng)驗(yàn) 獲得超30個(gè)贊
$update_sql = "UPDATE guestbook SET reply = '{$reply}', replytime = {$replytime} WHERE id = {$_POST[id]}";
試一下

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊
就是說你的數(shù)據(jù)庫程序有點(diǎn)問題。需要你會(huì)過去數(shù)據(jù)庫中修改,在第一行附近

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊
$update_sql?=?"UPDATE?guestbook?SET?reply?=?'"?.??mysql_real_escape_string($reply).?"',?replytime?=?'$replytime'?WHERE?id?=?{$_POST['id']}";

TA貢獻(xiàn)2條經(jīng)驗(yàn) 獲得超0個(gè)贊
?$update_sql = "UPDATE guestbook SET reply = '$reply', replytime = $replytime WHERE id = $_POST[id]";
改成 ??$update_sql = "UPDATE guestbook SET??reply = “.$reply.", replytime = ".$replytime."WHERE id = ".$_POST[id]; 試試看

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊
我覺得是錯(cuò)在'$reply' ? 既然你是字符串拼接 ? 就拼接起來啊 ? ?這是個(gè)字符串 ?在執(zhí)行sql語句時(shí)這個(gè)變量也要帶''單引號(hào)的
添加回答
舉報(bào)