Jump to content

Keywords


cyberstu

Recommended Posts

Hey all, Ive just spent 3 days trying to get a database working with sql and php. Does SQL have any keywords that are not allowed such as 'From' or 'To', I changed it to 'From_N' and 'To_N'. I thought that if these were field names it would make no difference. However I kept getting SQL errors and only just decided to change field names.

Link to comment
Share on other sites

http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html here is list of reserevd keywords which you cant use in column names. cause it has special meanings to mysql.
Link to comment
Share on other sites

Actually, you can use these words as table or column numbers, provided that they are always enclosed in back-ticks, e.g.

SELECT `FROM` FROM `SELECT` WHERE `WHERE`=1;

is valid syntax.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...