Jump to content

Online in last 24 hour


thaidomizil

Recommended Posts

Hi, i'm trying to create some detailed statistics about customer activity, i have entries in my mysql db when the customer has been active for the last time and want to create some statistics about that, basically a "online last 24 hours" but from specific countries.

 

Now i've tried this:

 

	
$time = date('Y-m-d H:i:s');
$time24 = date("Y-m-d H:i:s", time()-((60*60)*24));
$query = "SELECT COUNT(*) as Anzahl FROM customers WHERE country = 'de' AND time BETWEEN '$time' AND '$time24' ";

 

to get the current date and select all customers that have been available from the current date minus 24 hours, what's my mistake here, as this doesn't seem to work!

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.