Jump to content

Archived

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

Tandem

DATE_SUB?

Recommended Posts

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

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

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

Share this post


Link to post
Share on other sites

×

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.