How to sort hour out of time in PHP

Discussion in 'PHP' started by extraspecial, Oct 19, 2012.

  1. #1
    Hello guys,

    I have a database where user registrations are recorded and I also have a field where the time is recorded when sign-up completed, the time looks like this 17:03:59 no am - pm. Now I need to sort them according to hours and count how many people have signed up for example @ 17 so where time starts with 17. Any idea?

    Thanks
     
    Solved! View solution.
    extraspecial, Oct 19, 2012 IP
  2. #2
    Simplest form would be

    
    SELECT COUNT(*) FROM table WHERE time LIKE "17%"
    
    Code (markup):
     
    plussy, Oct 19, 2012 IP
  3. extraspecial

    extraspecial Member

    Messages:
    788
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    45
    #3
    Thanks dude! it worked and project completed....

     
    extraspecial, Oct 19, 2012 IP
  4. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #4
    No worries. glad could be of help.
     
    plussy, Oct 19, 2012 IP
  5. EitanXOR

    EitanXOR Greenhorn

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    EitanXOR, Oct 21, 2012 IP