Hello/Hi/Greetings,
when i open gallery photos, this fatal error shows. plz help to resolve this. Thanks
Fatal error: Uncaught mysqli_sql_exception: 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 in /home/bestphot/public_html/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0
(Piwigo 14.2.0 Check for upgrade
Installed on 30 November -0001, 2024 years 2 months 4 weeks 1 day ago
Operating system: Linux
PHP: 8.1.27 (Show info) [2024-02-29 05:24:11]
MySQL: 8.0.36-cll-lve [2024-02-28 20:24:11]
Graphics Library: GD bundled (2.1.0 compatible)
Cache size 0 Mo calculated 1 hour ago Refresh)
Piwigo URL: https://bestphotographer.ae
Offline
Hi :-)
I don't see this error
Only for admin error message ?
Offline
Unfortunately you omitted part of the error message that states the actual SQL query that fails. The "syntax to use near 'ASC'" though tells it is some sort order related so I presume it might be the dreaded "rank" vs "`rank`" problem mentioned several times in the forum. However, please provide the full message including the failing SQL statement.
Offline
Fatal error: Uncaught mysqli_sql_exception: 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 in /home/bestphot/public_html/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /home/bestphot/public_html/include/dblayer/functions_mysqli.inc.php(132): mysqli->query('\nSELECT DISTINC...') #1 /home/bestphot/public_html/include/dblayer/functions_mysqli.inc.php(888): pwg_query('\nSELECT DISTINC...') #2 /home/bestphot/public_html/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #3 /home/bestphot/public_html/index.php(12): include('/home/bestphot/...') #4 {main} thrown in /home/bestphot/public_html/include/dblayer/functions_mysqli.inc.php on line 132
Offline
It is not admin error. This error on most of gallery categories. While few are working fine.
Offline
Hi,
I checked and found that the following categories produce the error:
https://bestphotographer.ae/index.php?/category/57
https://bestphotographer.ae/index.php?/category/models
https://bestphotographer.ae/index.php?/category/kids
https://bestphotographer.ae/index.php?/category/71
https://bestphotographer.ae/index.php?/category/49
https://bestphotographer.ae/index.php?/category/46
https://bestphotographer.ae/index.php?/category/51
https://bestphotographer.ae/index.php?/category/47
https://bestphotographer.ae/index.php?/category/45
Do these categories have something in common that separates them from the working categories?
Like missing title/name, description or some other property?
Offline
Odd that the actual SQL query is not partially output in the message. Anyway, are those albums sorted by ranking? Then switch them to any other sorting order and then back to ranking.
See also [Forum, topic 33397] Piwigo 2.8.2 database error and many others.
Offline
Thanks for your kind reply
@erAck
@OHappyDay
@ddtddt
Actually I am not much familiar with coding and database. But from all your discussions , I conclude there may b something wrong with apparent setting of the galleries, like some title missing or some record missing. So I just swapped the sorting order of pictures in each gallery and submit , the problem is resolved.
Thank you guys :)
Offline
I was having a similar problem. I discovered the problem was with albums that had a manual sort. (Unfortunately this is most of my albums :()
After trying some other sort options, I discovered that all I needed to do to fix the problem was go into the album's Photos sort order, and just hit Submit at the top by the manual sort pictures.
Apparently this resubmitted my original manually chosen sort order and in doing so fixed whatever was off in the sql.
I hope this might help other folks.
And thanks for the above replies that got me this far!
BTW, my original fatal error message was:
Fatal error: Uncaught mysqli_sql_exception: 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 in /home/ladewitt/natomabaycve62.org/photogallery/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /home/ladewitt/natomabaycve62.org/photogallery/include/dblayer/functions_mysqli.inc.php(132): mysqli->query('\nSELECT DISTINC...') #1 /home/ladewitt/natomabaycve62.org/photogallery/include/dblayer/functions_mysqli.inc.php(888): pwg_query('\nSELECT DISTINC...') #2 /home/ladewitt/natomabaycve62.org/photogallery/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #3 /home/ladewitt/natomabaycve62.org/photogallery/index.php(12): include('/home/ladewitt/...') #4 {main} thrown in /home/ladewitt/natomabaycve62.org/photogallery/include/dblayer/functions_mysqli.inc.php on line 132
(If there was more to the error message I can't see it . . . but since the above seems to fix things, I'll be working on the fix rather than trying to recreate the errors :)
Offline