Jump to content

WHERE clause highest integer


MDanz

Recommended Posts

i tried this but it doesn't work. rating is a column with integer type.  it is returning the wrong row with the lowest rating.

 

how do i get the the highest rating(integer) in the WHERE clause?

 

$getrest =  mysql_query("SELECT * FROM block WHERE sid='505' ORDER BY 'rating' DESC LIMIT 1") or die(mysql_error());
while($row=mysql_fetch_assoc($getrest))
{
$name= $row['name'];

}

echo $name;

Link to comment
https://forums.phpfreaks.com/topic/230813-where-clause-highest-integer/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.