Parašė kugeliux· 2009 Vas. 22 17:02:34
#1
Turiu tasku sistema ir noriu pasidaryti top.Kai pasidarau man meta eror toki
Column 'user_id' in field list is ambiguous
kodas
openside("TOP 5");
$result = dbquery("SELECT user_name, user_id, count(user_id) AS user_id
FROM ".$db_prefix."users_money
INNER JOIN ".$db_prefix."users
ON user_id=user_id
GROUP BY user_name
ORDER BY money
DESC LIMIT 0,5
");
echo "<table width='100%'>
<tr><td><b>Nario vardas</b></td><td><b>Pinigai</b></td></tr>\n";
while ($data = dbarray($result)) {
echo "<tr><td><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td><td>".$data['money']."</td></tr>\n";
}
echo "</table>\n";
closeside();
mysql lenteles pavadinimas
mano prefix_users_money
o joje viskas atrodo taip
id user_id money
3 1 2
Jei galit sutvarkykite