Hello!
I hope maybe you can help me - whenever I call `printLatestUpdatedAlbums()` and set `$showdate = true` I get the following error:
Fatal error: MySQLi Error: ( SELECT COUNT(*) FROM `[prefix]images` WHERE albumid = 39 AND mtime = ) failed. MySQLi returned the 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 in /....../zp-core/functions-db-MySQLi.php on line 78 For example :
`printLatestUpdatedAlbums(5,true, true, false, 40, '', NULL, NULL, NULL, '', false, false);`
Everything works fine as long as `$showdate` is `false`.
The error seems to happen in `image_album_statistics.php` :
`function printAlbumStatisticItem(...)`
within
`
if ($showdate) {
if ($option === "latestupdated") { ...
`
Line 260: `'$count = db_count('images', "WHERE albumid = " . $tempalbum->getID() . " AND mtime = " . $latestimage['mtime']);'`
I'm not sure - but it appears that something is wrong in line 259 here:
`$latestimage = query_single_row("SELECT mtime FROM " . prefix('images') . " WHERE albumid = " . $tempalbum->getID() . " AND show = 1 ORDER BY id DESC");`
Because it seems in the line 260 `$latestimage['mtime']);'` is empty?And that messes up the SQL Syntax?
Appreciate any help, thank you!
Comments
I just checked - `var_dump($latestimage)` is `NULL`.