SQL syntax error
-
I have three sites on separate hosting packages with the same provider. They are all on PHP 8.3, WP 7.0.2, MariaDB 10.11.18, Weaver-Xtreme theme, Imagely(Nextgen) 4.2.3, meaning everything is up to date. The sites have no more than 5 albums, each with under 10 galleries, so not large.
Just one of those sites is throwing an SQL syntax error several times per day (see below). The timing is not related to any backend activity, or to any legitimate visitor according to my stats package. However, the stats package does not record bot/crawler access. The error message example is:
[19-Jul-2026 19:58:35 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 1 for query
SELECT DISTINCT wp_ngg_album.* , GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘extras’ FROMwp_ngg_albumLEFT OUTER JOINwp_postmetaONwp_postmeta.post_id=extras_post_idWHERE (idIN (0)) GROUP BY wp_ngg_album.id ORDER BY FIELD(id, )
made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/weaver-xtreme/page.php’), get_template_part, locate_template, load_template, require(‘/themes/weaver-xtreme/templates/content-page.php’), weaverx_the_page_content, weaverx_the_contnt, the_content, apply_filters(‘the_content’), WP_Hook->apply_filters, Imagely\NGG\Display\Shortcodes->parse_content, Imagely\NGG\Display\Shortcodes->execute_found_shortcode, Imagely\NGG\Display\Shortcodes->render_shortcode, Imagely\NGG\Display\DisplayManager->display_imagely_shortcode, Imagely\NGG\Display\DisplayManager->display_album_by_id, Imagely\NGG\DisplayedGallery\Renderer->display_images, Imagely\NGG\DisplayedGallery\Renderer->render, Imagely\NGG\DisplayTypes\Albums\SharedController->index_action, Imagely\NGG\DisplayTypes\Albums\SharedController->get_entities, Imagely\NGG\DataTypes\DisplayedGallery->get_included_entities, Imagely\NGG\DataTypes\DisplayedGallery->get_entities, Imagely\NGG\DataTypes\DisplayedGallery->_get_album_and_gallery_entities, Imagely\NGG\DataMapper\TableDriver->run_queryIt appears to be a select to do with albums. 4 of 5 albums were originally made in Nextgen v3. I took the trouble to delete each album in turn and recreate it in Imagely v4, followed by viewing each album. The messages were being created before, did not occur during the process, and continued later.
Any ideas? Is the problem at ‘(id in (0))’ ? Is ‘0’ an invalid value?
You must be logged in to reply to this topic.