Good Afternoon,
I'm struggling with something that should be simple (where I have most trouble - simple things)
Basically what I'm trying to do is when someone places an order on hold, I want to leave it on hold indefinitely unless someone else wants to place the same items on hold, then I check to see if what is on hold has been there for over 15 minutes (time enough for them to make the payment). If it has been there over 15 minutes than I will release the hold on it and allow the other person to purchase it.
I am querying a database like this:
$current=(date('Y-m-d G:i:s'));
$release_time="00:15:00";
$sql_r="SELECT order_id, mem_id, shares, placed_date, status FROM Zreserve_".$reserve." WHERE track_id='$reserve_rec' AND status <> 'R'";
$result_r=mysql_query($sql_r);
$request_r=mysql_fetch_array($result_r);
I get the results that I expect from that query.
Then I need to see if the value of the placed_date (datetime field) plus 15 minutes is < $current (basically set to now - above ...)
I have tried many variations on adding the 15 minutes and am coming up blank.
print"<br>release time is ".$release_time."<br>should release after ".($request_r[3]+$release_time);
// always prints out the it should release after 2012
if ($request_r[3]+$release_time < $current){
// do some stuff that never gets done
}
I know it is going to be simple and I will probably kick myself for even asking, but I need to get this script done, and I'm banging my head against the wall.
Thanks in advance for your assistance.
Douglas