Welcome Guest, Not a member yet? Register   Sign In
Trying to count all records from database
#1

Hi,

I am trying to grab the last 30 days of a table and using the pageid group them together but also add the groups together.  I have the following which does group them, but doesn't add them together.  I am not sure what I am missing.

PHP Code:
$query $this->db->query('SELECT *, COUNT(*)FROM analytics_page_views WHERE date BETWEEN NOW() - INTERVAL 30 DAY AND NOW() GROUP BY pageid');
return 
$query->result(); 

Can anyone advise on how I can get the group to count them as well please?

Thanks,
Doomie
Reply


Messages In This Thread
Trying to count all records from database - by doomie22 - 09-13-2017, 01:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB