Updating table record where field name is "AS"
Posted 10 May 2013 - 05:31 AM
I have a table where one field (column) is called AS. I know that is a command, but I was wondering if there is a way around it. I want to do this:
mysql_query("UPDATE registrations SET AS = '9' WHERE ID = '123' ");
That AS is throwing it off. I do not get an error, just 9 doues not appear under the AS column in the table.
Posted 10 May 2013 - 05:47 AM Best Answer
As "AS" is reserved word in MySQL, so may not be updating the record and also not giving any error as sql syntax is correct.
Try using this query
mysql_query("UPDATE registrations SET `AS` = '9' WHERE `ID` = '123' ");
Posted 10 May 2013 - 06:05 AM
You know that actually worked. I am happy that I do not have to think arround it.
I know that 2 letter words like AS IF OR are not the best ones to use.
Thanks so much!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users