I want to create a table using the following script:
mysql_query("create table `".$mysql_table_prefix."query_log` (
query varchar(255),
time timestamp(14),
elapsed float(2),
results int,
key query_key(query)
)");
It gives me this error:
#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 'mysql_query("create table `".$mysql_table_prefix."query_log` ( query varchar(25' at line 1
EDIT: I used sql tab in phpMyAdmin
What can I do?
You’re using PHP in a place that expects plain SQL (note that the OP stated “I used sql tab in phpMyAdmin”). Cut it down to:
And @Aurelio is right, there’s no length parameter to timestamp.