i have the code
<?php
mysql_connect( 'Localhost', 'xxx', 'xxx' );
mysql_select_db( 'xxx' );
$sql = "SELECT ID, username, worth FROM `users` ORDER BY Money DESC LIMIT 0,10";
echo '<table border="0" align="center" width="400" cellspacing="2" cellpadding="2">
<tr>
<td> Username </td>
<td> Networth </td>
<td> ID </td>
</tr>';
while ($disp_users = mysql_fetch_assoc($top10sql))
{
echo ' <tr>';
echo ' <td>' . $disp_users['username'] . '</td>';
echo ' <td>' . $disp_users['worth'] . '</td>';
echo ' <td>' . $disp_users['ID'] . '</td>';
echo ' </tr>';
}
echo '</table>';
?>
it show the username networth and id at top but gives me and error
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\index.php on line 45