<?php
require_once('dataBase.php');// 创建连接
$sql="INSERT INTO result_table(userName, yangxu, yinxu, shire, tanshi, qixu, qiyu, xueyu, tebing, pinghe, testTime, testDate )VALUES ('testname','12','12','12','12','12','12','12','12','12','12','201201201')";
$result=$conn->query($sql);
if ($conn->query($sql2) === TRUE) {
echo "新记录插入成功";
} else {
echo "Error: " . $sql2 . "
" . $conn->error;
}
$conn->close();
?>
想向自己数据库的表格 result_table中插入数据,数据连接已经成功,但总是无法插入,提示错误如下:
Error:
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 ', yangxu, yinxu, shire, tanshi, qixu, qiyu, xueyu, tebing, pinghe, testTime, tes' at line 1
请问谁知道症结所在么?谢谢!