Hey,
Ik heb een tabel genaamd users met "money" in als ik nu een highscore wil maken met al men users waarvan diegene met het meeste geld eerst staat en met het minste laatst hoe doe ik dit dan?
Jelle
707 views
<?php
$vQuery = "SELECT m.money, g.naam FROM tabel1 AS m, tabel2 as G WHERE g.id = m.g_id ORDER BY m.money DESC";
//ik dacht dat dit het was als je een genormaliseerde database hebt
//bij tabel1 is de tabel waar je geld instaat
//tabel2 is de members tabel
?>
<?php
$sql = "
SELECT username, money
FROM users
ORDER BY money DESC
";
?>
<?php
session_start();
if($_SESSION['s_logged_n'] == 'true'){
include 'process.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Bizzlife</title>
</head>
<body>
<center>
<table width="800" border="1">
<tr>
<th scope="col"><table width="800" height="703" border="0" bgcolor="#CCCCCC">
<tr>
<th height="39"><?php
include "upper2.htm";
?>
</p>
<hr />
<p><?php
include "membmenu.htm"
?></p></th>
</tr>
<tr>
<td height="591"><p align="left"><u>Ranglijst:</u></p>
<p align="left">
<?php
include "config.php";
$res = mysql_query("SELECT username,money FROM users ORDER BY money DESC LIMIT 0,30");
?></p>
<p align="left"><?php
echo "$res";
?></p>
<p align="left"> </p>
<p align="left"> </p>
<p align="left"> </p>
<p align="left"> </p>
<p align="left"> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p></td>
</tr>
<tr>
<td height="30"><?php
include "down.htm";
?></td>
</tr>
</table></th>
</tr>
</table>
</center>
</body>
</html>
<?php
} else {
header("Location: login.php");
}
?>