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)) {
?
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
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