[請益] insert 問題

看板PHP作者 (狂人)時間16年前 (2009/08/15 12:53), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
小弟實在找不出來問題出在哪兒~ $id=time(); $date=date('l jS \of F Y H:i:s'); $sql= "INSERT INTO 'list' ('id', '標題', '日期') VALUES ('$id','{$_POST['post_title']}','$date')"; if(file_put_contents('./news.inc/'.$id.'.inc.php',$_POST['post_content'])){ $err=mysql_query($sql); echo $sql."<br />"; echo mysql_error(); } INSERT INTO 'list' ('id', '標題', '日期') VALUES ('1250311705','news2','Saturday 15th of August 2009 04:48:25') 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 ''list' ('id', '標題', '日期') VALUES ('1250311705','news2','Saturday 15th of' at line 1 勞煩眾高手幫幫忙吧 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.115.193.58

08/15 13:21, , 1F
`list` (`id`, `標題`,`日期`)
08/15 13:21, 1F

08/15 13:54, , 2F
原來是mark的方式...thanks a lot
08/15 13:54, 2F
文章代碼(AID): #1AXZyn8f (PHP)
文章代碼(AID): #1AXZyn8f (PHP)