【发布时间】:2013-09-07 06:15:04
【问题描述】:
我想备份我的数据库时出错
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-01-000001' at line 1
SELECT * FROM temp_01-01-000001
Filename: F:\xampp\htdocs\erp_zaara\system\database\DB_driver.php
Line Number: 330
有没有办法用表名(temp_01-01-000001)解决这个问题。
【问题讨论】:
-
我的一般建议是:不要使用包含非法字符的表名(因此需要引用)。他们更麻烦,然后他们是值得的。这只是另一个例子。
-
破折号 (-) 它不是非法字符,但必须用反引号 (`) 引用。请参阅:dev.mysql.com/doc/refman/5.0/en/identifiers.html 和 bugs.mysql.com/bug.php?id=461
标签: mysql