#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    6
    Rep Power
    0
    Hey people- got a small issue maybe some of you can help with.

    I have a php script that inserts the date from a dynamically generated calendar into the 'Date' field in a mysql table.

    When I select the 'Date' field and 'order by date asc', it lists:
    11
    12
    13
    14
    15
    2
    6
    7

    - Obviously, I need my query to return:
    2
    6
    7
    11
    12
    13
    14
    15

    Does anyone have any idea's? I know it's not the script's fault, as mysql returns the same result from a command line query.
    I'm wondering if perhaps there is not a query element that would straighten this out...Thanks for everyone's time and thought.


    ------------------
    <A HREF="http://www.live2ride.net" TARGET=_blank>www.live2ride.net
    </A> The OnLine Ride...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    31
    Rep Power
    15
    You have Date as string and not as integer or date value in your mysql table. Integers and Dates are sorted in correct order (2,10,11) and not as strings (10,11,2)
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    6
    Rep Power
    0
    That fixed it... Admittingly, I did not check this, as I copied the table schema for my project from another persons existing database...

    Thanks for your time and help!!!

    ------------------
    <A HREF="http://www.live2ride.net" TARGET=_blank>www.live2ride.net
    </A> The OnLine Ride...

Similar Threads

  1. Problem with SELECT query
    By deano in forum MySQL Help
    Replies: 1
    Last Post: February 10th, 2004, 01:14 PM
  2. Select one resultrow from query result?
    By driz in forum PHP Development
    Replies: 1
    Last Post: February 10th, 2004, 11:59 AM
  3. Display and Refresh of PHP in URL query
    By wuji in forum PHP Development
    Replies: 3
    Last Post: January 30th, 2004, 01:20 PM
  4. Flash, PHP query problem
    By camcim in forum PHP Development
    Replies: 0
    Last Post: January 25th, 2004, 11:52 PM
  5. Can I query a network user with PHP?
    By BirdBlack in forum PHP Development
    Replies: 1
    Last Post: January 24th, 2004, 12:42 AM

IMN logo majestic logo threadwatch logo seochat tools logo