LinkSysAd Posted June 3, 2007 Share Posted June 3, 2007 I have here a simple table: [b]Avatar's Name Visited[/b] [b]Date and Time of Detect[/b] Walegg Etzel 2007-05-30 19:51:41 Plotunium Paine 2007-05-30 19:55:03 Brain Cazalet 2007-05-30 20:03:55 Sebby Voyager 2007-05-31 08:05:31 Urban Loon 2007-05-31 08:08:31 Klaas Berjis 2007-06-01 08:09:05 Note: the date and time of detect is one field only. Now based on the table above, I would like to create two queries such as below: 1. Current online: Assuming the date right now is 2007-05-30, how do I create a query that display the number of avatar on a current date. 2. Total visits: This is the cumulative count for the number of avatar visits. It should not only be unique Avatar visits. For example, if Walegg Etzel visited. She leaves and then back later on. That should log 2 counts for this statistic). Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/54103-create-a-query-for-this-given-table/ Share on other sites More sharing options...
paul2463 Posted June 3, 2007 Share Posted June 3, 2007 what you are after is the <a href="http://dev.mysql.com/doc/refman/5.0/en/counting-rows.html"> MYSQL COUNT() MANUAL</a> Quote Link to comment https://forums.phpfreaks.com/topic/54103-create-a-query-for-this-given-table/#findComment-267476 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.