[2.10.0RC1] rank is still an issue with MySQL 8 #932

Closed
opened 2026-10-05 00:24:14 +02:00 by adam · 3 comments
Owner

As reported on topic 29518

[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 '' at line 16

SELECT
    c.*,
    user_representative_picture_id,
    nb_images,
    date_last,
    max_date_last,
    count_images,
    nb_categories,
    count_categories
  FROM piwigo_categories c
    INNER JOIN piwigo_user_cache_categories ucc
    ON id = cat_id
    AND user_id = 1
  WHERE id_uppercat is NULL
     
  ORDER BY rank

#1    my_error include\dblayer\functions_mysqli.inc.php(132)
#2    pwg_query include\category_cats.inc.php(55)
#3    include index.php(301)
As reported on [topic 29518](https://piwigo.org/forum/viewtopic.php?id=29518) > [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 '' at line 16 ``` SELECT c.*, user_representative_picture_id, nb_images, date_last, max_date_last, count_images, nb_categories, count_categories FROM piwigo_categories c INNER JOIN piwigo_user_cache_categories ucc ON id = cat_id AND user_id = 1 WHERE id_uppercat is NULL ORDER BY rank #1 my_error include\dblayer\functions_mysqli.inc.php(132) #2 pwg_query include\category_cats.inc.php(55) #3 include index.php(301) ``` <!-- github-sync-id:487401393 -->
adam closed this issue 2026-10-05 00:24:14 +02:00
Author
Owner

As opposed to 8e9cb6de23 I have added generic code in pwg_query to escape the rank word in any SQL query.

That's not perfect, but less impact on code.

As opposed to 8e9cb6de23928b590912c71c3713ecfa17608d7c I have added generic code in `pwg_query` to escape the `rank` word in any SQL query. That's not perfect, but less impact on code. <!-- github-comment-id:526545456 -->
Author
Owner

i have this issues too

i have this issues too <!-- github-comment-id:536208680 -->
Author
Owner

I had an issue with the key word 'groups' and fixed is as described in my comment https://github.com/Piwigo/AMenuManager/issues/5#issuecomment-551291566

I had an issue with the key word 'groups' and fixed is as described in my comment https://github.com/Piwigo/AMenuManager/issues/5#issuecomment-551291566 <!-- github-comment-id:551296756 -->
adam changed title from [2.10.0RC1] rank is still an issue with MySQL 8 to [2.10.0RC1] rank is still an issue with MySQL 8 2026-10-27 11:14:19 +01:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#932