August 4, 2014 at 10:56 am
I keep getting an error that says:
problem with insertArray ( [0] => Array ( [0] => 22018 [SQLSTATE] => 22018 [1] => 0 => 0 [2] => [Microsoft][SQL Server Native Client 11.0]Invalid character value for cast specification [message] => [Microsoft][SQL Server Native Client 11.0]Invalid character value for cast specification ) )
My code is as follows below:
$sql = "UPDATE LegalContracts
SET con_ContractNumber=(?), con_Section=(?), con_Date=(?), con_DocType=(?), con_Description=(?), con_FileNumber=(?), con_Party=(?), con_Value=(?), con_StartDate=(?), con_ExecutionDate=(?), con_ExecutionDate=(?), con_Comments=(?), LegalContracts.con_state=(?)
WHERE con_Id = '$ref'";
$params = array(
array($_POST['con_ContractNumber']),
array($_POST['con_Section']),
array(test_dateInput($_POST['con_Date']),null, null, SQLSRV_SQLTYPE_DATETIME),
array($_POST['con_DocType']),
array($_POST['con_Description']),
array($con_FileNumber),
array($_POST['con_Party']),
array($_POST['con_Value']),
array(test_dateInput($_POST['con_StartDate']),null, null, SQLSRV_SQLTYPE_DATETIME),
array(test_dateInput($_POST['con_EndDate']),null, null, SQLSRV_SQLTYPE_DATETIME),
array(test_dateInput($_POST['con_ExecutionDate']),null, null, SQLSRV_SQLTYPE_DATETIME),
array($_POST['con_Comments']),
array($_POST['con_state'])
);
$insert_stmt = sqlsrv_query($conn,$sql,$params);
if ($insert_stmt === false){
echo "problem with insert";
die(print_r(sqlsrv_errors(),true));
}
August 4, 2014 at 2:28 pm
Quick thought, check the parameters, columns and the values data types as this is a datatype conversion error.
😎
August 4, 2014 at 6:18 pm
Ok will do...
I did but will check over again
August 4, 2014 at 9:58 pm
allanstarr023 (8/4/2014)
Ok will do...I did but will check over again
First place to look are the values of the strings being cast into date.
😎
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply