I have a simple mysql select query in my PHP code:
$result = mysql_query("SELECT text FROM example ORDER BY rank DESC"); while($row = mysql_fetch_array($result)) { echo $row['text'] . "<br>"; }
and this MySql table:
text | rank --------+-------- google | 245 --------+-------- yahoo | 32 --------+-------- bing | 12
When I get the query results, something like this will appear:
yahoo google bing
I want Google to come. I think that Yahoo is primarily because it starts with a "3".
How can I make the query sort the results by the size of the numbers in the rank?
Thanks...
source share