[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

alphanumeric ordering


Hello,
  I program for a game that allows users to attempt to choose the top ten in order from a NASCAR event.  I've been using MySQL for a couple of years on the backend (there is no gambling or prizes.  you play for pride and points.). It allows me to track users picks, handles, driver lists, etc.  I'm able to build my forms on the fly, etc.  However, the car numbers used to be purely numeric.  Now the numbers are mixed in that while there is a car number 1 there is also a car number "01" and they are different cars.  If I set the table up with the numbers as characters, they will not come up in order when queried ("select car_no from cars order by car_no;")  for ex: number 12 will com up before number 2.  I used to use an integer with a zero fill and all worked well, but I can no longer do this due to NASCAR's cowtowing to the teams.

Does anyone have any ideas on what to do here or should I just punt and build the list directly without using the database?  Its not like its a long list.  There are about 60 cars in total and only 44 in a race.  It just saves work if the game operator can fill out a form to enter or delete a car from the table and MySQL/PHP made that little task quite trivial.

Curtis


This mailing list archive is a service of Copilot Consulting.