Verfasst: 14.05.2003 16:29
Habs zurückgestellt sorry hatte vorhin was getestet 
esperitox

esperitox
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
INSERT INTO phpbb_rate_results VALUES (2, 87, 5, '50875136', 1051531580);
INSERT INTO phpbb_rate_results VALUES (2, 122, 4, '50875136', 1051531600);
INSERT INTO phpbb_rate_results VALUES (2, 121, 3, '50875136', 1051531613);
INSERT INTO phpbb_rate_results VALUES (2, 120, 2, '50875136', 1051531626);
INSERT INTO phpbb_rate_results VALUES (2, 118, 1, '50875136', 1051531639);
INSERT INTO phpbb_rate_results VALUES (5, 87, 4, 'd951eddf', 1051610420);
INSERT INTO phpbb_rate_results VALUES (5, 120, 5, 'd951eddf', 1051613637);
INSERT INTO phpbb_rate_results VALUES (3, 87, 4, 'd951eddf', 1051614115);
INSERT INTO phpbb_rate_results VALUES (3, 117, 5, 'd951eddf', 1051614146);
INSERT INTO phpbb_rate_results VALUES (5, 117, 5, 'd951eddf', 1051614190);
Code: Alles auswählen
$order_by = "rating_avg > 0 $sort_order, rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';
Code: Alles auswählen
SQL Error : 1054 Unknown column 'rating_avg' in 'order clause'
SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username , AVG(r.rating) AS rating_avg FROM phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2 LEFT JOIN phpbb_rate_results r ON r.topic_id = t.topic_id WHERE t.topic_poster = u.user_id AND p.post_id = t.topic_last_post_id AND p.poster_id = u2.user_id AND t.topic_type = 3 GROUP BY t.topic_id, u.user_id, u2.user_id ORDER BY rating_avg > 0 DESC, rating_avg DESC, t.topic_last_post_id DESC
Line : 485
File : /is/htdocs/*****/www.flashmetal.de/board/viewforum.php
Code: Alles auswählen
$order_by = "rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';