Hi - I installed Zenphoto version 1.2.2 [2983], and as long as I am on the admin pages, it works nice and neatly with my DB (MySQL version 4.0.27).
But once I logoff the admin interface, and try to access the gallery only via /zenphoto/index.php - this is the error message I get (below, I replaced all backticks with & , as this forum automatically would convert it to code):
`
Zenphoto Error
MySQL Query ( SELECT COUNT(*) AS row_count FROM &zp_images&,
&zp_albums& WHERE &zp_albums&.folder!="" AND &zp_images&.albumid = &zp_albums&.id
AND &zp_albums&.show = 1 AND &zp_images&.show=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 'show = 1
AND &zp_images&.show=1' at line 1
`
As a result, I can only see and work with my gallery as long as I am logged in as admin... :-(
Anyone who can help out? -thanks in advance!!
Comments
AND &zp_albums&.show = 1 AND &zp_images&.show=1` is not there when you are logged in, so presumably it is what is causing the problem. But why is a different question.
Presumably you are using the random image function as that seems where this code is. If so, find the lines which read:
`
$albumWhere = " AND " . prefix('albums') . ".show = 1" . getProtectedAlbumsWhere() ;
$imageWhere = " AND " . prefix('images') . ".show=1";
`
and change them to:
`
$albumWhere = " AND " . prefix('albums.show') . "=1" . getProtectedAlbumsWhere() ;
$imageWhere = " AND " . prefix('images.show') . "=1";
`
This is just a guess, really, since that code is working fine for me. But maybe there is a MySQL version issue involved.
inserting your suggested lines into template-functions.php ended up in a new error, so I removed that again.
Any other help how to deal with this? How to approach a solution, if there really was a MYSQL issue - what other data should I provide?
````
Zenphoto Error
MySQL Query ( SELECT COUNT(*) AS row_count FROM `zp_images`, `zp_albums` WHERE `zp_albums`.folder!="" AND `zp_images`.albumid = `zp_albums`.id AND `zp_albums.show`=1 AND `zp_images.show`=1 ) failed. Error: Unknown column 'zp_albums.show' in 'where clause'
````
NB - I cannot manage to keep the backticks visible, how do I quote the code with backticks inside of it?
As to the potential of it being a MySQL issue, you would just use a different version. If you could move up to the version 5 level it might resolve the issue. But even version 4 should be allowing this syntax, so maybe it is just a problem for the particular version you are on and any other might work.
Hope that it remains stable, but am confident - you have any experiences with MySQL 5.x and Zenphoto?
Apart from that... let me express this is a beautiful piece of work you have done here, very very nice look and feel ;-)
cheers, mapi