I have a code that makes a voting system, and when a user votes, the number goes up +1 in the database under the "top5votes" field in my database..
I have a page that outputs whos in the lead, and how many votes they have... But I am getting a problem, the person in the lead has a 2 digit number of votes, like 12, 24, 49, or w/e. It puts them at the bottom of the list and everyone else in good order from the most to least votes...
My code is
Code: Select all
<?
$username2= "muot_report";
$password2= "passswr";
$database2= "muot_report";
$connection2 = mysql_connect('localhost',$username2,$password2);
mysql_select_db($database2);
$sql4 = "SELECT * FROM `report` WHERE top5 =1 ORDER BY `top5votes` DESC";
$result = mysql_query($sql4) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
echo "<tr class=odd><td align=center>".$row['prevname']."</td><td align=center>".$row['top5votes']."</td></tr>";
}
?>