OK, new to this forum, struggling with something here. All I'm after is a simple php/mysql script that checks to make sure something isn't stuck in the queue, and if there is something stuck, to send a mail off. Currently what I've started with.
$query = "SELECT orderid FROM store_soap_queue WHERE done != 1 AND started >= SUBDATE(NOW(), INTERVAL 10 MINUTE)";
$results = @mysql_query($query);
if($results){
$orderid = array();
while($row = @mysql_fetch_array($results)){
$orderid[] = $row['orderid'];
}
$notify = print "The order ID that didn't go thru: $orderid at [".date('Y-m-d h:i:sa')."]";
$mailaddress = "name@addresswhatever.com";
$mailsubject = "Stuff still in queue";
$mailbody = $notify;
mail($mailaddress,$mailsubject,$mailbody);
}
I know I'm probably messing something up with the subdate() function. But I could be off, and am not the brightest star in the sky when it comes to mysql/php.