问题描述:

When I import a csv file in phpmyadmin it automatically calls the table "table 1". Renaming the table is just one extra step I'd rather not take but the code below doesn't work because there's a space in the name. How can I refer to this table called "TABLE 1" when there's a space in the name?

$data = mysql_query("SELECT * FROM TABLE 1")

网友答案:

wrap it in backticks (`)

$data = mysql_query("SELECT * FROM `TABLE 1`");

Note: on a standard keyboard this is the to the left of the numeric "1" key

相关阅读:
Top