SQL Server error : [Microsoft][ODBC Driver 13 for SQL Server]

问题内容:

So basically my problem is I am trying to insert values in my SQL Server table (maker_form_details), and I have no idea why I am getting this error.

Here is a sample of my code

$sqlquery = "INSERT INTO maker_form_details(caseid,nom,address,date,no_de_tel,quest_no,lieu_interview,tom,mainbank,netscore,overallsatisfaction,q12_comment,q13_probablite,q14_comment,q15_recommendation,q16_sarisfaction,q17_temps,q19,q20Bancassurance,Mobhile_Banking,q21ameliorer) values ($id,'$Name','$address','$date',$tel,'$quest','$lieu','$tom','$mainbank',$netscore,$overallsatisfaction,'$question12','$question13','$question14',$question15,$question16,$question17,'$question19','$question20p1','$question20p2','$question21')";

$resultquery = sqlsrv_query($conn, $sqlquery);

if(!$resultquery){
print_r(sqlsrv_errors());
}

The error is:

Array ( [0] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 102 => 102 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near ','. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near ','. ) )

问题评论:

原文地址:

https://stackoverflow.com/questions/47756163/sql-server-error-microsoftodbc-driver-13-for-sql-server

添加评论