SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member oregonbum's Avatar
    Join Date
    Apr 2003
    Location
    Grants Pass, Oregon
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ascii to Binary or a better way

    I've got a client who lists their newsletter on the website - pulled in from the database & ordered by Title.

    So when they got to volume 10, they wondered why it showed up at the top of the list instead of the bottom - I explained the ascii way of organizing numbers.

    They don't upload their NL's in order, so using a datestamp isn't a solution at this point.

    Will PHP change ascii to binary? So if they put in a "10", will it change it to whatevery binary is and put it after "9"?

    Or, is there a better solution?

  2. #2
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oregonbum
    I've got a client who lists their newsletter on the website - pulled in from the database & ordered by Title.

    So when they got to volume 10, they wondered why it showed up at the top of the list instead of the bottom - I explained the ascii way of organizing numbers.

    They don't upload their NL's in order, so using a datestamp isn't a solution at this point.

    Will PHP change ascii to binary? So if they put in a "10", will it change it to whatevery binary is and put it after "9"?

    Or, is there a better solution?
    Simply add a column type of type INT representing the Volume (i.e. 1, 2, 3, ..., 10), and ' ORDER BY Title, Volume'.

    Then MySQL (or whataver DBMS you are using) will sort as the user intends it to)
    My name is Steve, and I'm a super-villian.

  3. #3
    SitePoint Member oregonbum's Avatar
    Join Date
    Apr 2003
    Location
    Grants Pass, Oregon
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks much! Works like a charm, and client it beaming!



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •