Announcement

#1 2024-04-16 18:59:28

Stephen Winters
Member
Oregon
2013-12-20
24

Most albums working, some give mysql error 1064

Hi All,
I'm having a problem with my Piwigo:  https://pgallery.winterssewing.com/ Can you help me figure out and fix the problems?

THE PARENT LIST OF ALL ALBUMS IS HERE:
https://pgallery.winterssewing.com/inde … categories
My Piwigo has 242 albums holding 6,839 photos.

Most of the albums are working fine. For example, here is a link to one of the albums that is working fine:
https://pgallery.winterssewing.com/inde … tegory/178

However, Some of the albums don't open with pictures, but instead they go to an error message. I've copied the links and the error messages of 6 of the problem albums below. Can someone help me figure out what the problem is and how to fix it. I went to the phpMyAdmin and did a "check table" on all the tables. They are said, "Status OK".   Any ideas as to what to do from here?
In trying to find solutions, among the various articles I saw, I found this article: How to Fix the MySQL 1064 Error (5 Methods) It basically talks about "mistype" or "obsolete" commands. Well, I haven't been typing any commands. We've just been clicking on the album links. No typing of commands.
This Piwigo has been working fine for years. I notice that there is a newer Piwigo version available. Should I try to fix the problem before upgrading, or will upgrading fix the problem?
What are your thoughts?
Hopefully,
Stephen

Now, below here are some links to the albums, including the error messages.

SOME OF THE ALBUMS WITH ERRORS
https://pgallery.winterssewing.com/inde … tegory/186

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 piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 186

   ORDER BY rank ASC
; in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 847


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /home/customer/www/pgallery.winterssewing.com/public_html/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /home/customer/www/pgallery.winterssewing.com/public_html/index.php(12): include('/home/customer/...') #2 {main} thrown in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 908

https://pgallery.winterssewing.com/inde … tegory/186

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 piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 186

   ORDER BY rank ASC
; in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 847


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /home/customer/www/pgallery.winterssewing.com/public_html/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /home/customer/www/pgallery.winterssewing.com/public_html/index.php(12): include('/home/customer/...') #2 {main} thrown in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 908

https://pgallery.winterssewing.com/inde … tegory/194 

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 piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 194

   ORDER BY rank ASC
; in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 847


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /home/customer/www/pgallery.winterssewing.com/public_html/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /home/customer/www/pgallery.winterssewing.com/public_html/index.php(12): include('/home/customer/...') #2 {main} thrown in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 908

https://pgallery.winterssewing.com/inde … tegory/180

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 piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 180

   ORDER BY rank ASC
; in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 847


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /home/customer/www/pgallery.winterssewing.com/public_html/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /home/customer/www/pgallery.winterssewing.com/public_html/index.php(12): include('/home/customer/...') #2 {main} thrown in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 908

https://pgallery.winterssewing.com/inde … tegory/179

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 piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 179

   ORDER BY rank ASC
; in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 847


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /home/customer/www/pgallery.winterssewing.com/public_html/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /home/customer/www/pgallery.winterssewing.com/public_html/index.php(12): include('/home/customer/...') #2 {main} thrown in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 908

https://pgallery.winterssewing.com/inde … ategory/74

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 piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 74

   ORDER BY rank ASC
; in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 847


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /home/customer/www/pgallery.winterssewing.com/public_html/include/section_init.inc.php(317): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /home/customer/www/pgallery.winterssewing.com/public_html/index.php(12): include('/home/customer/...') #2 {main} thrown in /home/customer/www/pgallery.winterssewing.com/public_html/include/dblayer/functions_mysqli.inc.php on line 908

OPERATING SYSTEM
(Piwigo 12.2.0 Check for upgrade
Operating system: Linux
PHP: 7.4.33 (Show info) [2024-04-16 08:40:47]
MySQL: 8.0.34-26 [2024-04-16 10:40:47]
Graphics Library: External ImageMagick 7.1.1-26
Cache size 4324.22 Mo   calculated 1 week ago Refresh [Administration > Tools > Maintenance])

Piwigo URL: https://pgallery.winterssewing.com/


Stephen Winters
An upholsterer since 1966, who has a passion for writing, computers, photography & video
http://winterssewing.com | http://upholsteryresource.com

Offline

 

#2 2024-04-16 19:24:05

erAck
Only trying to help
2015-09-06
2038

Re: Most albums working, some give mysql error 1064

The usual "rank is now a keyword" problem. See
[Forum, post 188923 by erAck in topic 33397] Piwigo 2.8.2 database error and
[Forum, post 188936 by erAck in topic 33397] Piwigo 2.8.2 database error and dozens of other topic threads in this forum if you search for rank keyword.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2024-04-16 20:26:08

Stephen Winters
Member
Oregon
2013-12-20
24

Re: Most albums working, some give mysql error 1064

Hi erAck,
Thank you very much for taking the time to respond to my request. I much appreciate your efforts. Because your message is so short, I'm wondering if you were short on time and didn't have time to adequately write your message. What I mean is this. It would have greatly helped me if you would have started your message with some explanation first, telling me what the problem is and what your message means..
I am confused by your response. I don't understand it. For one thing, what does "rank is now by keyword" mean or what does it have to do with my problem? Could you please explain what your thoughts or instructions are? Could you also explain why you gave me those links and what am I supposed to do with them?
Thanks,
Stephen

P.S. I went to see your photo album [ https://erack.net/gallery/ ]. Thanks for sharing photos of your travels. Very nice! I really like your theme. Which theme is that?

Last edited by Stephen Winters (2024-04-16 20:50:33)


Stephen Winters
An upholsterer since 1966, who has a passion for writing, computers, photography & video
http://winterssewing.com | http://upholsteryresource.com

Offline

 

#4 2024-04-16 23:29:05

OHappyDay
Member
2023-02-08
64

Re: Most albums working, some give mysql error 1064

Hi Stephen,

as I understand from the linked post, this is the important message:

--------
Your problem is not the database name (why should it even be?) but the "ORDER BY rank" where rank is not escaped as it is a keyword since MySQL 8. The remedy is to change sort order on affected albums to something else and then back to ranking, as that will write the escaped `rank` to the database which will then be used on further queries.
--------

I guess that the error happens after an upgrade to MySQL 8. The sort order was in place before the upgrade which then is broken because the term "rank" is now a keyword and must be escaped to be recognized as a column name.
So try to follow the above instructions that should change that SQL statement in the background to the correct syntax.

Offline

 

#5 2024-04-18 18:43:17

erAck
Only trying to help
2015-09-06
2038

Re: Most albums working, some give mysql error 1064

Stephen Winters wrote:

Because your message is so short, I'm wondering if you were short on time and didn't have time to adequately write your message.

Everything you need is in the posts I linked to that I already wrote earlier. Why should I repeat.

what does "rank is now by keyword" mean

It means that the word rank used in the query is now a MySQL keyword and needs to be escaped by surrounding it with ` backticks to form `rank`.

or what does it have to do with my problem?

Your problem occurs because the word rank is used unescaped in the query.

Could you please explain what your thoughts or instructions are? Could you also explain why you gave me those links and what am I supposed to do with them?

Read. Understand. Act accordingly. If you don't know how to replace values in the database then for each album that is sorted by rank, once set it to a different sort order and then set back to ranking. As written in one of those two posts.

Thanks for sharing photos of your travels. Very nice! I really like your theme. Which theme is that?

Thanks. It's [extension by Piwigo Team] elegant along with [extension by P@t] GThumb+ for mansion style thumbnails.


Running Piwigo at https://erack.net/gallery/

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact