You are not logged in.
What the hell is going on here? This worked fine until a recent update.
SELECT * FROM "table";
ERROR 1064 (42000): 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 '"table"' at line 1
SELECT * FROM 'table';
ERROR 1064 (42000): 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 ''table'' at line 1
SELECT * FROM `table`;
(table prints normally here)
12 rows in set (0.00 sec)
The error happens both in the mysql client, phpmyadmin, and all my php scripts. How do I make it accept single and double quotes?
Phpmyadmin has this to say about the mySQL installation
Server: Localhost via UNIX socket
Server version: 5.1.50
Protocol version: 10
User: root@localhost
MySQL charset: UTF-8 Unicode (utf8)
Last edited by Krause (2010-10-16 10:18:16)
Offline
Hello
In the SQL Standard, table and column names don't have to be between quotes, only values can be (for instance if you have spaces in a value).
Just call "SELECT * FROM table;", that's all.
Offline
But what if the table name has a space in it?
Offline
But what if the table name has a space in it?
Use backticks?
Jay
Offline
MySQL is notorious for not following SQL standards. Single quotes are only acceptable and if you have spaces, use back tics.
./
Offline