0

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.

1
  • Why do you have the %'s? Commented Dec 22, 2011 at 16:43

2 Answers 2

1

For one, you're trying to echo an array. Try print_r($data)

Sign up to request clarification or add additional context in comments.

Comments

1

familarize yourself with the

       now() 

function in mysql

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_now

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.