Reputation: 1281
I use this code, which should return me total amount (sum) of clients registrered/joined in last 7 days (sun-sat).
require '../dbconnect.php';
$result = full_query ('SELECT COUNT(*) FROM tblclients WHERE date between \'' . date ('Y-m-d', mktime (0, 0, 0, date ('m'), date ('d') - 7, date ('Y'))) . '%\' AND \'' . date ('Y-m-d') . '%\'');
$data = mysql_fetch_array ($result);
echo $data;
For some reasson, I get no results. Please help.
Upvotes: 0
Views: 69
Reputation:
familarize yourself with the
now()
function in mysql
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_now
Upvotes: 1