ZenphotoCMS Forum
Bug in getItemByID - 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: Bug in getItemByID (/thread-11045.html)



Bug in getItemByID - jphilbert - 2013-05-09

If a item does not exist it gives a :

"Fatal error: MySQL Error: ( SELECT * FROM [prefix]albums WHERE id = ) failed. MySQL returned the error MySQL not connected in /home1/glamwor2/public_html/clients.zen.com/zp-core/functions-db-MySQL.php on line 69"

$imageobject = getItemByID("images", '4000'); (wrong or removed ID)

any way to check the if exists to avoid this error so I can do a proper exit out the code?




Bug in getItemByID - sbillard - 2013-05-10

The function can be improved to test the result of the first query and abort if it fails. But the error you report is strange. MySQL should simply have returned a syntax error, not aborted.




Bug in getItemByID - jphilbert - 2013-05-10

yea the abort kills my script ...




Bug in getItemByID - emdub - 2013-05-28

I'm running into a similar error:

Fatal error: MySQL Error: ( SELECT id, date, data FROM [prefix]search_cache WHERE criteria='a:5:{s:4:\"item\";s:6:\"albums\";s:6:\"fields\";s:4:\"tags\";s:6:\"search\";s:20:\"a:1:{i:0;s:3:\"Vue\";}\";s:4:\"sort\";s:1:\" \";s:4:\"user\";s:13:\"76.173.231.93\";}' ) failed. MySQL returned the error MySQL not connected in /var/www/vhosts/my-domain.com/httpdocs/gallery/zp-core/functions-db-MySQL.php on line 69

I this first when clicking on an image's tag. If I hit the back button, any link will give the same error. If I start over (refresh gallery home), I can navigate normally, as long as I don't click a tag.

I am not sure exactly when this started.




Bug in getItemByID - sbillard - 2013-05-29

You should try clearing your search cache. But as to why MySQL is going away, your server or MySQL logs are the only possible clue.




Bug in getItemByID - emdub - 2013-05-30

Setting Cache expiry to 0 in options -> search stops the error from occurring, but when I turn it back on, the errors start up again. I'm not sure where to clear it.

I'll take a look at the MySQL logs to see if I can determine the underlying issue.




Bug in getItemByID - fretzl - 2013-05-31

On the admin => overview tab are buttons to purge the cache.