ZenphotoCMS Forum
Error in SQL syntax - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Error in SQL syntax (/thread-118.html)



Error in SQL syntax - RogerUsh - 2005-10-21

I tried re-installing zp in another folder and I am getting this error:

MySQL Query ( SELECT * FROM 01_portfolio-albums ) Failed. Error: 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 '-albums' at line 1

Setup.php runs smoothly, and I changed all the config.php and .htaccess variables I could think of.

Does anybody have any idea what this error means?

Much appreciated.

-the_rog




Error in SQL syntax - RogerUsh - 2005-10-21

ps. I should also include the fact that I got the error when trying to access the admin page after running setup.php successfully.

I get this error when trying to access the gallery:

MySQL Query ( SELECT *, (date + 0) AS date FROM 01_portfolio-albums WHEREfolder='' LIMIT 1; ) Failed. Error: 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 '-albums WHEREfolder='' LIMIT 1' at line 1




Error in SQL syntax - trisweb - 2005-10-22

It looks like your "mysql prefix" variable in the config file is set to '01_portfolio-' -- Table names cannot contain dashes, and I didn't check for that.

Remove the dash (change to an underscore) and re-run setup.




Error in SQL syntax - dom - 2005-10-22

Hi,

Just to clarify, MySQL table names can contain dashes, but if you are going to use them then you must delimit the table name with backticks, eg:

SELECT * FROM 01_portfolio-foo

edit:

Ok, the formatting on these forums turns backticks into code, so I cannot give an example. :/




Error in SQL syntax - RogerUsh - 2005-10-24

Thanks!