mysql_query("
INSERT INTO trades (id, cpair, oprice, cprice, bos, ooc, dateandtime)
VALUES (null, $currency, $openingprice, $closingprice, $buysell,
$openorclosed, $datetime"
);
這段代碼的錯誤是這樣的錯誤?你的SQL語法有錯誤;檢查對應於你的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 ' , 1, 1, 2012-10-12 13:57:08' at line 1
看起來''datetime'後面有一個缺少的元素。 'mysql_query(「INSERT ... VALUES(...,$ datetime)」);' - 語法錯誤會更清晰,如果您將生成的查詢字符串分配給變量並且var_dump()編輯它 –
has你的錯誤現在改變了,你把這些引號放在你的變量上? –