Page 1 of 1

how to handle sql reserved word?

Posted: Tue Dec 06, 2005 1:32 am
by jaylin
in php, i dun know who to handle sql reserved word in the query string. plz tell me.

Posted: Tue Dec 06, 2005 1:42 am
by shiznatix
you are going to have to be more specific. if you want to use a sql reserved word in a mysql query then just put it in the query.

Posted: Tue Dec 06, 2005 1:46 am
by jaylin
for example my table name is "SELECT" and my field name is "FROM", so, wht i should do?
shiznatix wrote:you are going to have to be more specific. if you want to use a sql reserved word in a mysql query then just put it in the query.

Posted: Tue Dec 06, 2005 4:37 am
by Skittlewidth
put back-ticks round the table name and field name ie.

Code: Select all

SELECT `FROM` FROM `SELECT`
That's seriously going to confuse you when you go back to edit your code though. Why would you name your tables this way?

Posted: Tue Dec 06, 2005 4:44 am
by Chris Corbyn
Sounds like school work :P