SQL Syntax error when attempting to create new album

I have been having a lot of trouble trying to get ZP to work, and have combed through this forum trying to find a solution. Perhaps I am missing something really obvious. I have installed and uninstalled it several times, and have been communicating with my webhost. I'm getting confused with all the different permutations of errors I get. So, having re-installed it one more time, I'm wondering if I can go through each problem, step by step, one at a time. If I'm really lucky, maybe the solution for the first few errors will cascade down to the rest. I'd really appreciate any help anyone may be able to provide.

The story so far, up to the first error msg:
1. The website is a subdomain (http://boboramdesign.augatti.com) hosted on a shared server by AussieHQ (AussieHosts) with Apache 2.0.52, PHP 4.4.1 and MySql 4.1.15
2. I uploaded all the zenphoto 1.0.1 files
3. Deleted the .htaccess file
4. Edited the database login info and admin details in config.php.example and renamed it
5. In config.php I changed to $conf 'mod_rewrite'] = false;
6. Starting on the next line in config.php I added:
define('SERVERPATH', '/var/www/vhosts/augatti.com/subdomains/boboramdesign/httpdocs/zenphoto');
define('WEBPATH', '/zenphoto');
define('SERVERCACHE', SERVERPATH . "/cache");
define('WEBCACHE', WEBPATH . "/cache");
7. I chmodded "albums" and "cache" to 777
8. I got AussieHQ to disable PHP Safe Mode on the domain
9. Ran http://boboramdesign.augatti.com/zenphotos/zen/setup.php - got prompted to login, all okay
10. I got the screen with:
zenphoto setup
Creating tables...
You can now View your gallery, or administrate
11. Clicked on administrate and went to http://boboramdesign.augatti.com/zenphoto/zen/admin.php
12. Clicked the upload tab, and tried to upload a .jpg image to a new album called "Oram44CJustAddWater"
13. Received this error msg: MySQL Query ( UPDATE albums SET `title`='Oram44CJustAddWater' WHERE `id`= ) 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 '' at line 1

Can anyone shed light on how to resolve this problem? Any suggestions will be warmly welcomed!


  • Well, it turned out to be a problem with the server path supplied to me by the webhost. Investigating the error logs revealed this. Once this was amended in the relevant line in the config.php file, I was able to create albums and upload files.

    Then entered the next problem - after the upload I was returned to a blank page, and no thumbnails or images were visible, although they were there on the server. Further investigation of the error log revealed a "cannot modify header" error. I searched this forum again and found this: http://www.zenphoto.org/support/topic.php?id=32 I had inadvertantly inserted trailing blanks after the final ?> - even though it clearly said not to edit below the line! I deserved this!

    Thank you so much for a wonderful application, I knew it was worth persevering with. All my problems turned out to be self-inflicted. So I'm now going to try integrating it with WP2 - let's see how difficult I can make this for myself!
  • Oh yes, I did do another thing.... In functions.php I commented out this:
    //if (strstr(basename(dirname($_SERVER['SCRIPT_NAME'])), "zen")) {
    // define('WEBPATH', dirname(dirname($_SERVER['SCRIPT_NAME'])));
    //} else {
    // define('WEBPATH', dirname($_SERVER['SCRIPT_NAME']));
    //define('SERVERPATH', dirname(dirname(__FILE__)));
    //define('SERVERCACHE', SERVERPATH . "/cache");
    //define('WEBCACHE', WEBPATH . "/cache");

    I am not using the .htaccess method.
Sign In or Register to comment.