asked on
Function InsDocInfoRec($wrkRecvDate, $emailSendDate, $strIdocMoney, $strIDOCNbr)
{
// INSERTS ONE PER TEXT FILE
$primaryid = '';
$strRegionId = trim($_SESSION['RegionId']) ;
$strSecTotal = trim($strIdocMoney);
$strSecTotal = preg_replace('/[^0-9.-]/', '', $strSecTotal);
$strSupplier = $_SESSION['GlobalSupplier'];
$strFees = 0;
// NEW DATE FORMAT
$timestamp = strtotime($emailSendDate);
$wrkFixedEmailSentDate = date("Y-m-d", $timestamp);
ECHO '<BR><BR><BR>REGION ID: ' . $strRegionId;
ECHO '<BR>SUPPLIER: ' . $strSupplier;
ECHO '<BR>IDOCNBR: ' . $strIDOCNbr;
ECHO '<BR>VENDOR/DETAIL TOTAL: ' . $strSecTotal;
ECHO '<BR>DATE RECEIVED: ' . $wrkFixedEmailSentDate . '<BR><BR>';
$connect = new PDO("sqlsrv:Server=$servername;Database=$dbname", $_SESSION['uid'], $_SESSION['pwd']);
try {
$insRec = "CALL EXEC ins_new_importIDocInfo(:RegionId,:Supplier,:IDoc,:AmtRcvd,:DateRcvd,:Fees,@RECID)";
$stmt = $connect->prepare($insRec);
$stmt->bindParam(':RegionId', $strRegionId, PDO::PARAM_STR);
$stmt->bindParam(':Supplier', $strSupplier, PDO::PARAM_STR);
$stmt->bindParam(':IDoc', $strIDOCNbr, PDO::PARAM_STR);
$stmt->bindParam(':AmtRcvd', $strSecTotal, PDO::PARAM_STR);
$stmt->bindParam(':DateRcvd', $wrkFixedEmailSentDate, PDO::PARAM_STR);
$stmt->bindParam(':Fees', $strFees,PDO::PARAM_STR);
$stmt->execute();
$result = $stmt->fetch();
$primaryid = $result['@RECID'];
var_dump($primaryid);
$strLogMsg = $strLogMsg . 'IMPORTIDOCINFO-INSERTED: ' . strval($srtRegionId)
. '-' . strval($strSupplier) . '-' . strval($strIDOCNbr)
. '-' . strval($strSecTotal) . '-' .strval($wrkFixedEmailSentDate)
. '-' .strval($strPrimaryKeyIdoc) . PHP_EOL;
RtnWriteLogMsg($strLogMsg);
} catch (PDOException $e) {
echo $e->getMessage();
$errmsg = $e->getMessage();
echo '<BR>UNABLE TO INSERT RECORD INTO InsDocInfoRec</br>';
echo '<BR>ERROR MSG: ' . $errmsg;
echo '<BR>EXITING APPLICATION</br>';
echo '<BR><BR> ** UNABLE TO INSERT DETAIL LINE INTO InsDocInfoRec **';
$strLogMsg = 'SQL STATEMENT FAILED WITH ERROR: ' . $errmsg . PHP_EOL;
RtnWriteLogMsg($strLogMsg);
$nbr = ($nbr + 1);
die($e);
}
return $primaryid;
}
And this is the only error I receive and then it continues processing.C:\wamp\www\Emails\Emails-V7.php:793:null
Any help would be appreciated.. thank you in advance.