order desc problem

2006-07-09 Thread M B Neretlis
the order comes out of sequence showing 10.11.12.13 etc before the number 2--- Can anyone help me out ?php //get user tips $query = @mysql_query(SELECT * FROM tips WHERE user_id = $user_id AND comp_id = $comp_id ORDER by round DESC); while ($result = @mysql_fetch_array($query)) { ?

Re: order desc problem

2006-07-09 Thread Aleksandar Bradaric
Hi, the order comes out of sequence showing 10.11.12.13 etc before the number 2--- Can anyone help me out That's because you are sorting the result on a string (char/varchar) column. Try using CAST to convert it to int or something similar: ORDER BY cast(column as unsigned) Best

Re: order desc problem

2006-07-09 Thread Chris Sansom
At 20:27 +0800 9/7/06, M B Neretlis wrote: the order comes out of sequence showing 10.11.12.13 etc before the number 2--- Can anyone help me out ?php //get user tips $query = @mysql_query(SELECT * FROM tips WHERE user_id = $user_id AND comp_id = $comp_id ORDER by round DESC); while