Aloha,
We have recently noticed some albums in our gallery are unable to be accessed, reporting mysql error 1064. Reported errors follow a similar pattern.
Examples follow (an unknown number of other albums also have this behavior):
ERROR 1
Link: https://photos.384thbombgroup.com/index … egory/2104
This album link, titled "A2 Jacket Art”, is found on the main page of this gallery.
Error message:
Warning: [mysql error 1064] 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 'ASC' at line 7
SELECT DISTINCT(image_id)
FROM piwigo384_image_category
INNER JOIN piwigo384_images ON id = image_id
WHERE
category_id = 2104
AND (category_id NOT IN (2199,3331,5344) AND level<=8)
ORDER BY rank ASC
; in /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/include/dblayer/functions_mysqli.inc.php on line 847
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/index.php(12): include('/home/u_group/p...') #2 {main} thrown in /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/include/dblayer/functions_mysqli.inc.php on line
Also...
ERROR 2
Link: https://photos.384thbombgroup.com/index … egory/5253
This album link, titled “Jeanne050”, is found in the Community album.
Error message:
Warning: [mysql error 1064] 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 'ASC' at line 7
SELECT DISTINCT(image_id)
FROM piwigo384_image_category
INNER JOIN piwigo384_images ON id = image_id
WHERE
category_id = 5253
AND (category_id NOT IN (2199,3331,5344) AND level<=8)
ORDER BY rank ASC
; in /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/include/dblayer/functions_mysqli.inc.php on line 847
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/index.php(12): include('/home/u_group/p...') #2 {main} thrown in /home/u_group/preller.us/384thBombGroupWebsite/htdocs/piwigo_384th_gallery/include/dblayer/functions_mysqli.inc.php on line 908
Environment
Piwigo 13.2.0 Check for upgrade
Installed on 7 June 2015, 7 years 5 months 1 week 6 days ago
Operating system: Linux
PHP: 7.4.30 (Show info) [2022-11-21 08:05:14]
MySQL: 8.0.28-0ubuntu0.20.04.3 [2022-11-21 08:05:14]
Graphics Library: External ImageMagick 6.9.7-4
Cache size N/A never calculated Refresh
Activated plugin list 19
Admin Tools
Autocorrect Filename
Back2Front
Batch Downloader
Charlie's content 3.2.4
Check Files Integrity
Comments on Albums
Community
Contact Form
Custom Download Link
Edit Filename
Exif View
Extended Description
File Uploader
Image Preview
LocalFiles Editor
Photo Update
Piwigo Donate
prevnext
Piwigo URL: https://photos.384thbombgroup.com/
Offline
Problem is the unescaped rank word where rank is now a keyword in MySQL. There are about a dozen threads on this in the forum. Search. It boils down to changing the album sort once to another ordering and then back to ranking, with which the escaped word is written to the database and used later.
Offline
Thanks. That cured my problem. I was a bit disappointed that it had to be done on an album-by-album basis - I would have thought Piwigo would protect against this, especially with the latest update.
Anyway, it works and we are back to "normal" operation - and we know what to do when it happens to other albums.
rfp
Offline