cyberstu Posted March 8, 2011 Share Posted March 8, 2011 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 More sharing options...
birbal Posted March 8, 2011 Share Posted March 8, 2011 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 More sharing options...
trevelluk Posted March 10, 2011 Share Posted March 10, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.