Forum Moderators: coopster
Assuming you have a field post_date in the record, assuming it's the data type datetime,
$expirehours=12;
$expireunit= 'hour';
$select = "select post_date >= date_sub(now(),interval $expirehours $expireunit) from post_table where record_id='$thisRecordId'";
$result = @mysql_query("$select") or error("Could not check for expire time on post");
$row = mysql_fetch_array($result);
mysql_free_result($result);
if (! ($row[0] > 0)) { error("Edit time has expired"); }
error is of course your error output function; if your post_date field is a date type and not datetime, use curdate() instead, but you won't be able to fine tune it by hours, only by days.