|  | 
| 
			 
			#1  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  Database Query: COUNT(*) 
			
			How can I perform:  SELECT COUNT(*) FROM vote_voterswith $mysidia->db->select()?? edit (answer): PHP Code: 
			Then perhaps, as above, but a count of all rows in vote_voters between two variable dates, such as: SELECT COUNT(*) FROM vote_voters WHERE date >= '{$date1}' and date < '{$date2}'(Mental notes to self: format needs to be 2015-01-15, that is, (Y-m-d).) edit (answer): PHP Code: 
			Next, both of the last two above (all time and between certain dates), but also taking into account: WHERE username = '{$user}'(Mental notes to self, $user = $mysidia->input->get("user") on profile pages.) edit (answer): PHP Code: 
			Would it be possible to pull a list of the names of the top 10 users (this week/month)?? (Though this is problematic as uid is not currently being stored in vote_voters, so I can't use it as a secondary order checker, and alphabetic just won't cut it, as older members should have precedence in score charts). edit (answered by HoF over aim, huge thanks!) PHP Code: 
			Can I also get the most common pet type in owned_adoptables? edit (answered by HoF over aim): see below In the end I will want to set nine variables: 
 Later I may extend this data to 'factions', to create a competitive atmosphere, not just against other players, but other faction groups. The most active factions getting rewarded regularly, of course.   
				__________________ Please do not contact me directly outside of Mysidia. I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 01-19-2015 at 03:24 AM. | 
| 
			 
			#2  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   Quote: 
 PHP Code: 
			PHP Code: 
			
				__________________  Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. | 
| 
			 
			#3  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Thanks for all the help over aim, HoF! I really appreciate it and I learned a lot of new things. For anyone interested in more things to modify their stats page with, this will list the 10 newest users: PHP Code: 
			
				__________________ Please do not contact me directly outside of Mysidia. I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 01-19-2015 at 04:32 AM. | 
| 
			 
			#4  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			The stats view page?
		 | 
| 
			 
			#5  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Yes, in statsview.php. ^^
		 
				__________________ Please do not contact me directly outside of Mysidia. I also cannot troubleshoot code more than two years old - I legit don't remember it. | 
| 
			 
			#6  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Awesome. Thank you ^^
		 | 
|  | 
| Tags | 
| database, database queries, mysql, stats | 
| 
 | 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| CSS Query .-. | ChibiMaestro | Templates and Themes | 2 | 12-08-2012 05:51 AM | 
| Delete query deletes from all usesrs | SilverDragonTears | Questions and Supports | 8 | 05-14-2012 07:49 PM | 
| Having a problem running a query | !Alive | Questions and Supports | 8 | 03-11-2012 02:39 PM | 
| Reward Message Character Count - answered, thank you! | we are halloween | Questions and Supports | 3 | 09-26-2010 07:43 AM | 
| Join query for optimization? | Arianna | Questions and Supports | 2 | 04-09-2010 12:32 PM | 
| What's New? | What's Hot? | What's Popular? |