Soldato
- Joined
- 24 Nov 2002
- Posts
- 16,376
- Location
- 38.744281°N 104.846806°W
In my php/mysql, the order is coming literally: 1, 10, 11, 2, 3.... Is there an easy way to prevent this? it is most annoying.
Worked. I had to change the order of my functions though, cheers!Augmented said:There's also natsort() for sorting a PHP array (of strings) as you want.
.
Then you can also set it to auto_increment and not need to worry about checking whether the key exists before adding it to the table 

But it would also mean changing the way your database works, and seeings you already have a solution there's probably not much point...