How many records since last value?

Discussion in 'PHP' started by jmansa, Aug 23, 2009.

  1. #1
    Is it possible to look through db tables/columns for a specific user and count how long back forinstance he has reported the number "3"?

    If my table looks like this:
    userid, rec1, rec2, rec3

    So if the user (1) has recorded 3 times like this:
    uid, 2, 2, 3
    uid, 1, 2, 2
    uid, 2, 1, 2


    The reuslt of my query should be "6":

    Is this possible?!?! and if yes... HOW?

    Thanks in advance!
     
    jmansa, Aug 23, 2009 IP
  2. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't get it
     
    Kyosys, Aug 23, 2009 IP
  3. Gray Fox

    Gray Fox Well-Known Member

    Messages:
    196
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Seems like he needs to "count the appearance of numbers after the last appearance of number X (in this case '3')"

    I think I'm going to let someone with more MySQL experience than myself to answer that, hope I made things a bit clearer.
     
    Gray Fox, Aug 23, 2009 IP