troubleshooting Question

Mysql q

Avatar of Hans Inge Hagen
Hans Inge HagenFlag for Norway asked on
4 Comments1 Solution319 ViewsLast Modified:
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?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros