Quote 'rank' field name in SQL

Add backticks to reserved word 'rank' in SQL queries.

Bug: GH #919
This commit is contained in:
Sam Wilson
2018-08-30 13:33:05 +08:00
committed by Pierrick Le Gall
parent af85a62199
commit 8e9cb6de23
4 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -143,11 +143,11 @@ SELECT
representative_ext,
width, height, rotation,
name,
rank
`rank`
FROM '.IMAGES_TABLE.'
JOIN '.IMAGE_CATEGORY_TABLE.' ON image_id = id
WHERE category_id = '.$page['category_id'].'
ORDER BY rank
ORDER BY `rank`
;';
$result = pwg_query($query);
if (pwg_db_num_rows($result) > 0)