如何在mysql中按降序获取行?

I am fetching the record from the table , i try my best to fetch by different method but not returning fine results .

I uses following code:

<?php 

$new_act_q=mysql_query("SELECT new_act FROM exel_file ORDER BY new_act DESC LIMIT 5");
while($new_act_f=mysql_fetch_assoc($new_act_q)){
echo $new_act_f['new_act']."<br>";
}

?>

But i am getting the wrong results , The result is showing as:

8

8

8

58

58

the returning result is not in the descending order.

If you want a numeric sorting order then new_act must be some numeric data type, or if the datatype is not some kind of numeric then cast it to a suitable numeric datatype in the query.

Try to cast your row as UNSIGNED [INTEGER]:

SELECT new_act FROM exel_file ORDER BY CAST(new_act AS UNSIGNED) LIMIT 5