Jump to content

escape for minus


ev66

Recommended Posts

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

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
Not 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

Archived

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

×
×
  • Create New...