I am facing issues while inserting multiple records in sql server using php.
Here is my query:-
INSERT INTO [BP].[users](id,username,email,contact,status) VALUES
('12','sujata','[email protected]','8588841506','0'),
('13','sonali','[email protected]','7894561231','0'),
('14','khushboo','[email protected]','7894561230','0')
It shows me this error message always:-
Msg 103010, Level 16, State 1, Line 20
Parse error at line: 2, column: 49: Incorrect syntax near ','.
This is my query from php file:-
$query = "INSERT INTO users(id,username,email,contact,status,num_update) VALUES $import_data ;
This is what import data returns
('12','sujata','[email protected]','8588841506','0'),('13','sonali','[email protected]','7894561231','0'),('14','khushboo','[email protected]','7894561230','0')
When I print the query it shows:-
INSERT INTO users(id,username,email,contact,status) VALUES ('12','sujata','[email protected]','8588841506','0'),('13','sonali','[email protected]','7894561231','0'),('14','khushboo','[email protected]','7894561230','0')
When I print Sql Error,it shows:-
SQLSTATE: 42000
code: 103010
message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Parse error at line: 1, column: 104: Incorrect syntax near ','.
SQLSTATE: 42000 code: 103010 message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Parse error at line: 1, column: 104: Incorrect syntax near ','.