No longer getting new image data
Hello. We were getting image data up until recently using the code below. As of Wednesday June 24, 6:00am, our import started failing. We are getting other listing data but have been unable to retrieve image data since Wednesday. We have our script email us when it fails. Whatever error is taking place doesn't generate a failure state.
The code we're using is below. I'd appreciate any thoughts or leads on things we should check.
Thank you, David
if (count($mls_ids) > 0) {
$today = date('Y-m-d H:i:s', time());
foreach ($mls_ids as $mls) {
//get photos
$photos_array = array();
$photos_array = $rets->GetObject("Property", "Photo", $mls, "*", 1);
if (count($photos_array) > 0) {
$count = 1;
//delete current images
$temp_record_delete_sql = "DELETE FROM `imgsDocs` WHERE `L_ListingID` = ".$mls." AND `type` = 'image'";
if($connection->query($temp_record_delete_sql) === false) {
echo 'Error on line 531';
sendErrorEmail($connection->error, E_USER_ERROR, $temp_record_delete_sql);
trigger_error('Wrong SQL: ' . $temp_record_delete_sql . ' Error: ' . $connection->error, E_USER_ERROR);
}
//insert photo information into table
foreach ($photos_array as $photo) {
if ($photo['Location'] != '') {
$photos_insert_sql = "INSERT INTO `imgsDocs` (`L_ListingID`,`resource`,`type`,`url`,`order`,`import_date`) VALUES (".$mls.",'Property','image','".$photo['Location']."',".$count.",'".$today."')";
if($connection->query($photos_insert_sql) === false) {
echo 'Error on line 540';
sendErrorEmail($connection->error, E_USER_ERROR, $photos_insert_sql);
trigger_error('Wrong SQL: ' . $photos_insert_sql . ' Error: ' . $connection->error, E_USER_ERROR);
}
}
$count++;
}
}
}
}
Comments
David, based on our off-line conversations, I believe this issue has been resolved. If that is the case, can you provide some technical details of how you solved it, if it was code based?