Jump to content

number issue with ORDER BY


perky416

Recommended Posts

Hi Guys,

 

When im pulling data from my database and displaying it on my page, im using ORDER BY in my query to display the data in alphabetical order. When it comes to displaying data with numbers in it, it isnt ordering how i want it.

 

Example:

This is how it is currently ordering the data:

 

test1

test10

test11

test12

test13

test14

test15

test16

test17

test18

test19

test2

test20

 

and so on....

 

How would i go about getting it to display like:

 

test1

test2

test3

test4

test5

test6

test7

test8

test9

test10

test11

test12

 

and so on....

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/232313-number-issue-with-order-by/
Share on other sites

Hi guys,

 

Im completely at a loss with this.

 

Im working on a domain script, so people could add domains such as 10.com, test1.com, ismell.com, so it will never be a fixed format.

 

Im tearing my hair out lol. I cant seem to find anything on google about this to work with.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.