Code: Select all
<?php
require("dbQS.php");
$strPart = CheckPost('hidPart', '');
$strCountryOfOrigin = CheckPost('txtCountryOfOrigin', '');
$intPO = CheckPost('hidPO', '');
$strMfg = CheckPost('hidMfg', '');
$strTariffCode = trim(CheckPost('txtTariffCode', ''));
$ssql = "SELECT TariffCode, ID FROM InventoryMaster1 WHERE ([PART #] = '$strPart')";
$rs = $dbc->execute($ssql);
if (!$rs->EOF)
{
$strOldTariffCode = $rs['TariffCode'];
$intID = $rs['ID'];
}else{
$strOldTariffCode = "";
$intID = "";
}
$rs->close;
$rs=null;
if (is_null($strOldTariffCode))
{
$strOldTariffCode = "Test";
}
echo $strOldTariffCode;
I have replaced the is_null with empty and it produced the same error. I have also changed it to if (trim($strOldTariffCode) == NULL) and it still produces a seperate error of:
Warning: trim() expects parameter 1 to be string, null given
Any ideas on how to get past this? Basically, I just want the result ot be a blank value if it is a NULL value