How many records since last value?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmansa
Forum Commoner
Posts: 81
Joined: Wed Aug 23, 2006 4:00 am

How many records since last value?

Post by jmansa »

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!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: How many records since last value?

Post by John Cartwright »

I don't see how you would get 6 from that dataset, can you explain again?
Post Reply