lisali
Erfahrenes Mitglied
Okay, danke. Ich hab es jetzt so übernommen:
und bekomme folgenden Fehler:
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 'GROUP BY `user_id`.user_id ORDER BY ranking DESC ) A' at line 10
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given ...
PHP:
$query = mysql_query("SELECT
@rownum:=@rownum+1 AS rang,
DATA.*
FROM
(SELECT @rownum:=0) AS vars,
(SELECT
`user_id`.`id`,
`user_id`.`user_id`,
SUM(`user_id`.`rankingUp`-`user_id`.`rankingDown`) AS ranking
GROUP BY
`user_id`.user_id
ORDER BY
ranking DESC
) AS DATA
");
echo mysql_error();
#$query = mysql_query("SELECT `user_id` FROM `users_img` ORDER BY `score` DESC LIMIT 10");
$i=1;
while ($img = mysql_fetch_array($query)) {
echo "<a href='?s=user&id=".$img['user_id']."'>
<img class='border' height='220' width='210' src='users/".$img['user_id']."/user.jpg' alt='' title='Platz #".$i."' /></a>";
und bekomme folgenden Fehler:
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 'GROUP BY `user_id`.user_id ORDER BY ranking DESC ) A' at line 10
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given ...