Click here to Skip to main content
15,905,504 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
PHP
INSERT INTO rekorde (wo, vorname, nachname, ergebnis, alter, klasse, gender) 
		VALUES (:wo, :vorname, :nachname, :ergebnis, :alter, :klasse, :gender)", 
		array($_POST["where"],$_POST["pren"],$_POST["name"],$_POST["res"],$_POST["alter"],$_POST["klasse"],$_POST["gender"]));


This code produces the following error:
[ near "alter": syntax error ]
Exception Name: NS_ERROR_FAILURE
Exception Message: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement]
Posted

1 solution

Alter is a keyword in SQL so if you have a column named alter, the best option would be to change the name of the column. Otherwise, you'll have to put the column name in square brackets: [alter]
 
Share this answer
 
Comments
Chi Ller 8-Jun-15 15:30pm    
thanks a lot. Stupid mistake. Shame on me :D
ZurdoDev 8-Jun-15 15:36pm    
You're welcome. ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900