$sql_ba = mysqli_query($db, "INSERT INTO buyer_accounting VALUES '', '10', 'mel', '8', 'sept142015', '120.00', 'none', '1'");
错误:错误描述:您的SQL语法中有错误;查看与您的MySQL服务器版本对应的手册,以便在#' 20' 20' 10','''',&##附近使用正确的语法39; 8',' sept142015',' 120.00','无',' 1''在第1行
我从周日开始尝试了一百种方法,我总是得到同样的错误
编辑:这是修正后代码的样子;
$sql_ba = mysqli_query($db, "INSERT INTO buyer_accounting (id, buyer_id, name, bp_used, auction_id, tax_collected, tax_id, pd) VALUES ('', '$buyer_num', '$b_info[0]', '$bp', '$auction_id', '$tax', '$tax_id', '1')");
答案 0 :(得分:1)
您需要在语句中添加括号:
$sql_ba = mysqli_query($db, "INSERT INTO buyer_accounting VALUES ('', '10', 'mel', '8', 'sept142015', '120.00', 'none', '1')");
答案 1 :(得分:0)
最好是明确的。您还忘了在查询中添加括号。
$sql_ba = mysqli_query($db, "INSERT INTO buyer_accounting (COLUMN-NAMES-HERE)
VALUES ('', '10', 'mel', '8', 'sept142015', '120.00', 'none', '1')");
并将COLUMN-NAMES-HERE
替换为您的实际列名。
参考:
答案 2 :(得分:0)
尝试添加'('在您的查询中,就像这样
INSERT INTO buyer_accounting VALUES ('', '10', 'mel', '8', 'sept142015', '120.00', 'none', '1'");