datesub question

Posted by Ahmet vardar on Stack Overflow See other posts from Stack Overflow or by Ahmet vardar
Published on 2010-05-15T23:30:18Z Indexed on 2010/05/15 23:40 UTC
Read the original article Hit count: 125

Filed under:
|

Hi,

is it possible to use date_sub like this ?

$dt = date("Y-m-d h:i:s");

$query = "INSERT INTO `table` (`date`) VALUES ('DATE_SUB('$dt', INTERVAL 15 DAY)')";

$result = MYSQL_QUERY($query);

Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php