Jump to content


Photo

DATE_SUB?


  • Please log in to reply
No replies to this topic

#1 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 08 October 2006 - 12:00 AM

I want to use the mysql DATE_SUB function, but i want the interval time to be specified with a variable.

<?php
$ter_check = mysql_query("DELETE FROM BLAH WHERE OCCUPANT='$_SESSION[username]' AND NOW() < DATE_SUB(ENTERED, INTERVAL '$ter_res[11]' HOUR)");
?>

Is this possible, and if so, is the way above the right way?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users