ravin
02-23-2007, 04:08 PM
Hello!
Im trying to figure out how to show tickets on my site thats older then 14 days, how do i do that? here are my codes
/* old_tickets */
$now_old = 'NOW()';
$sql_old = "SELECT * FROM `hesk_tickets` WHERE `dt`<= $now_old AND ";
$sql_old .= Categories();
$sql_old .= " AND `status`>=1 ";
$result_old = dbQuery($sql_old)
$all_old = dbNumRows($result_old);
At the moment it shows all tickets, if i replace this for an example :
$sql_old = "SELECT * FROM `hesk_tickets` WHERE `dt`<= '2007-01-23 11:48:03' AND ";
I can see that it only shows some tickets, older ones..that it should be.
But how do i trim the $now_old variable so that it automatic will be put 14 days older than just NOW() = todays date etc.:confused:
what im after is something like :
$now_old = 'NOW()'-14days :P
Im trying to figure out how to show tickets on my site thats older then 14 days, how do i do that? here are my codes
/* old_tickets */
$now_old = 'NOW()';
$sql_old = "SELECT * FROM `hesk_tickets` WHERE `dt`<= $now_old AND ";
$sql_old .= Categories();
$sql_old .= " AND `status`>=1 ";
$result_old = dbQuery($sql_old)
$all_old = dbNumRows($result_old);
At the moment it shows all tickets, if i replace this for an example :
$sql_old = "SELECT * FROM `hesk_tickets` WHERE `dt`<= '2007-01-23 11:48:03' AND ";
I can see that it only shows some tickets, older ones..that it should be.
But how do i trim the $now_old variable so that it automatic will be put 14 days older than just NOW() = todays date etc.:confused:
what im after is something like :
$now_old = 'NOW()'-14days :P