這是我的編碼:錯誤「您的SQL語法錯誤;」近table_name的
session_start();
include 'Connect.php';
$userid=$_SESSION['userid'];
$tanggal=date('Y-m-d h:i:s');
$status='Pending';
echo $userid;
echo $status;
echo $tanggal;
mysql_query("INSERT INTO 'Order' (IdPelanggan,Tanggal,StatusOrder) VALUES ('$userid', '$tanggal', '$status')") or die (mysql_error());
我運行編碼後,我得到這個錯誤:
`9Pending2013-07-27 11:25:54You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Order (IdPelanggan,Tanggal,StatusOrder) VALUES (9, 2013-07-27 11:25:54, Pending)' at line 1`
我不知道我的錯誤是..
什麼是你的表中'StatusOrder'列的mysql數據類型? '日期'或'日期時間'? – amaster