Bug #54945 again: MySQL 4 does not support aggregation in ORDER BY.

Moved the MIN(smiley_order) to the SELECT column list now, so it can be
used for sorting on MySQL 4, but also still works on MSSQL, which the
bug was originally about.
This commit is contained in:
Marek A. Ruszczyński 2010-03-02 20:36:26 +01:00 committed by Nils Adermann
parent 5003595ed6
commit 93a2407f65

View file

@ -85,10 +85,10 @@ function generate_smilies($mode, $forum_id)
if ($mode == 'window')
{
$sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height
$sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height, MIN(smiley_order) AS min_smiley_order
FROM ' . SMILIES_TABLE . '
GROUP BY smiley_url, smiley_width, smiley_height
ORDER BY MIN(smiley_order)';
ORDER BY min_smiley_order';
$result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600);
}
else