Im trying to make a MYSQL query where my members training log will be counted.
So, here is what I need to do:
Every day a member swipe their member card trough a card reader. This card reader will log the event in a mysql table. This table will log the id, memberid, name and timestamp from the card. There are members that will swipe the card two or more times. I therefor need to count is as only 1 log per day. My current query looks like this:
select count(log_user_id) as uID from $medlem_log_table WHERE log_user_id='$username' group by year(regdato_user)
There are mistakes here and I got to make it correct. Anyone?