1
使用php向sql server插入名稱和密碼時出錯。 任何人都可以幫助我嗎?使用表格插入到sql server數據庫中
$name = $_POST['add_name'];
$password =$_POST['add_pass'];
$query = "INSERT INTO zTest(user, password) VALUES ('".$name."','".$password."');";
$params = array();
$options = array("Scrollable" => SQLSRV_CURSOR_KEYSET);
$stmt = sqlsrv_query($conn, $query, $params, $options);
if($stmt === false){
die (print_r (sqlsrv_errors(), true));
}
錯誤消息:
陣列([0] =>數組([0] => 42000 [SQLSTATE] => 42000 [1] => 156 [代碼] => 156 [2] => [Microsoft] [SQL Server Native Client 11.0] [SQL Server]關鍵字'user'附近的語法錯誤[message] => [Microsoft] [SQL Server Native Client 11.0] [SQL Server]附近關鍵字'用戶'))