mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-04 20:42:53 +02:00
merge r6321 from branch 2.1 to trunk
bug 1682: r6312 was producing a MySQL error (depending on the MySQL server version) because a count() implies a group by. This code change was checked against MySQL 5.0.75, MySQL 5.0.51 (where the error occured) and SQLite 3.6.22. git-svn-id: http://piwigo.org/svn/trunk@6322 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -301,10 +301,11 @@ SELECT
|
||||
LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id
|
||||
LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme
|
||||
WHERE ui.user_id = \''.$user_id.'\'
|
||||
GROUP BY ui.user_id
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
$user_infos_row = pwg_db_fetch_assoc($result);
|
||||
if (0 == $user_infos_row['counter']) {
|
||||
if (!isset($user_infos_row['counter']) or 0 == $user_infos_row['counter']) {
|
||||
create_user_infos($user_id);
|
||||
|
||||
$result = pwg_query($query);
|
||||
|
||||
Reference in New Issue
Block a user