Jump to content

[SOLVED] Simple show all registrations between 4.59pm yesterday and now


wmguk

Recommended Posts

Hey guys,

 

I have a simple script to display any registrations since 5pm yesterday, however it only shows registrations since midnight...

 

$from_date = date('Y-m-d',strtotime('now 0 days 5pm'));
$to_date = date('Y-m-d',strtotime('now +1 days'));
$qryto = "BETWEEN '{$from_date}' AND '$to_date'";

WHERE reg_date $qryto AND active='1'

 

Any ideas why this isnt working?

Hi,

 

Thanks for that, I've tried it but it doesnt work,

 

my DB has the reg_date displaying as 2009-02-19 15:22:10

 

and if i echo $time I get 2009-02-20 17:00:00 (I changed it to -3 days so that it will display several records (currently 3 registrations since 20th after 5pm, but still shows none....

 

could it be the qry?

 

if i echo the qry string i get

 

SELECT * FROM candidateinfo WHERE reg_date > 2009-02-20 17:00:00 AND active='1' ORDER BY reg_date DESC

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.