Hmm... Giver dette ikke det, du vil have? SELECT username, source.point AS webpoint, pix.point AS gfxpoint FROM users LEFT JOIN source ON source.udgiver=username LEFT JOIN pix ON pix.udgiver=username LIMIT $start$limit
SELECT username, source.point AS webpoint, pix.point AS gfxpoint, webpoint+gfkpoint AS ialt FROM users LEFT JOIN source ON source.udgiver=username LEFT JOIN pix ON pix.udgiver=username ORDER BY ial DESC LIMIT $start$limit
Prøv det, og se om ikke det giver det, du vil have:
$query = mysql_query(\"SELECT username, source.point AS webpoint, pix.point AS gfxpoint, webpoint+gfkpoint AS ialt FROM users LEFT JOIN source ON source.udgiver=username LEFT JOIN pix ON pix.udgiver=username ORDER BY ial DESC LIMIT $start$limit \"); while($row = mysql_fetch_array($query)) { echo $row[\'username\'].\' har \'.$row[\'gfxpoint\'].\'+\'.$row[\'webpoint\'].\'=\'.$row[\'ialt\'].\" point.<br>\\n\"; }
SELECT username, source.point AS webpoint, pix.point AS gfxpoint, source.point+pix.point AS ialt FROM users LEFT JOIN source ON source.udgiver=username LEFT JOIN pix ON pix.udgiver=username ORDER BY ial DESC LIMIT $start$limit
function mysort($a, $b) { return $a[\'ialt\']-$b[\'ialt\']; }
uasort ($users, \'mysort\');
foreach($users as $username=>$userdata) { echo \"$username: {$userdata[\'ialt\']} point<br>\\n\"; }
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.