The following code outputs in order of 1, 10, 11, 12 of id.
I want to make it 1,2,3,4...
Could anyone tell me what I should do please.
$Q = $
As previously mentioned MySQL doesn't support alphanumeric sorting. One common trick to solve this is to first order by length:
ORDER BY LENGTH(column_name), column_name
As long as the non-numeric part of the value is the same length, this will sort 1 before 10, 10 before 100, etc.