ev66 Posted November 10, 2007 Share Posted November 10, 2007 Hi,i'm trying the query$result = mysql_query("SELECT * FROM cd-r48x");but it does not work because of the minus sign in the table name cd-r48xI've triedmysql_query('SELECT * FROM "cd-r48x"');andmysql_query("SELECT * FROM cd-r48x");and$a="cd-r48x";mysql_query("SELECT * FROM $a");but still cant get it to work how can i code it to accept the minus sign ?Thank you in advance Link to comment Share on other sites More sharing options...
Reg Edit Posted November 10, 2007 Share Posted November 10, 2007 Hi,i'm trying the query$result = mysql_query("SELECT * FROM cd-r48x");but it does not work because of the minus sign in the table name cd-r48xI've triedmysql_query('SELECT * FROM "cd-r48x"');andmysql_query("SELECT * FROM cd-r48x");and$a="cd-r48x";mysql_query("SELECT * FROM $a");but still cant get it to work how can i code it to accept the minus sign ?Thank you in advanceNot sure about MySQL myself, but in MS SQL you would use square brackets. Give that a try:SELECT * FROM [cd-r48x] Link to comment Share on other sites More sharing options...
ev66 Posted November 10, 2007 Author Share Posted November 10, 2007 No that didn't work, thanks for trying though. Link to comment Share on other sites More sharing options...
Synook Posted November 11, 2007 Share Posted November 11, 2007 What about $result = mysql_query("SELECT * FROM `cd-r48x`"); Link to comment Share on other sites More sharing options...
ScottR Posted November 11, 2007 Share Posted November 11, 2007 Silly question.... Why can't you rename the table?? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.