pioneerx01 Posted May 10, 2013 Share Posted May 10, 2013 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. Thanks Link to comment https://forums.phpfreaks.com/topic/277866-updating-table-record-where-field-name-is-as/ Share on other sites More sharing options...
PravinS Posted May 10, 2013 Share Posted May 10, 2013 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' "); Link to comment https://forums.phpfreaks.com/topic/277866-updating-table-record-where-field-name-is-as/#findComment-1429432 Share on other sites More sharing options...
pioneerx01 Posted May 10, 2013 Author Share Posted May 10, 2013 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! Link to comment https://forums.phpfreaks.com/topic/277866-updating-table-record-where-field-name-is-as/#findComment-1429434 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.