⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

drop down with ascending numbering



Jack Magdalene

Jack Magdalene
  • profile picture
  • Member

Posted 23 March 2013 - 13:06 PM

Hi Everyone,

 

I have a problem with the order of items in a drop-down list. My database table is setup with sequential numbering, both ID and the select items. But when you select the drop-down list, the items are mixed up. Please see the attached screen shot.

 

I would like to see the following:

 

Count:

1

2

3

4

5

etc.

 

Can someone tell me how to fix this or point me in the right direction?

 

Thanks!

Jack


likhon3k

likhon3k
  • profile picture
  • Member

Posted 24 March 2013 - 03:28 AM

Hi Everyone,

 

I have a problem with the order of items in a drop-down list. My database table is setup with sequential numbering, both ID and the select items. But when you select the drop-down list, the items are mixed up. Please see the attached screen shot.

 

- You can't set ascending or descending order for integer value. it will take 1, 10,11, 2 this way.

 

You can solve this problem by taking your id as varchar format.


Jack Magdalene

Jack Magdalene
  • profile picture
  • Member

Posted 24 March 2013 - 13:34 PM

Hi likhon3k,

 

Thank you for the help. I'll make the suggested changes right away.

 

I changed the table to varchar as primary key and removed the auto_increment but when I select the drop down menu it's still showing the same mixed up sequence (0,1,10,11,12...), what I want is: 0,1,2,3,4,5...

 

It must be PHP that's rendering the numbers non-sequential. Any other thoughts?

 

Jack