I m facing same problem and even i m using literal also, see my code:
Error in executing GetSpecificAuto for LastRecord. Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -14 [code] => -14 [2] => An invalid parameter was passed to sqlsrv_query. [message] => An invalid parameter was passed to sqlsrv_query.
function GetAuto(){$params = array(array("InquiryForm"),
array("Last"),
array(0),
array(""),
array($LastAuto,SQLSRV_PARAM_OUT,SQLSRV_SQLTYPE_DECIMAL(20, 0)));
$processauto = "{CALL GetSpecificAuto(?,?,?,?,?)}";
$getauto = sqlsrv_query($conn,$processauto,$params);
if($getauto === false)
{
echo "Error in executing GetSpecificAuto for LastRecord. \n";
die( print_r( sqlsrv_errors(), true));
}
sqlsrv_free_stmt( $getauto);
return $LastAuto;
}
$auto = GetAuto();
echo $auto;
its not working. My Connection is also working fine. I have checked it with sqlsrv_server_info(), i m also trying this same with the return type array, i need to create a function which returns a array, but that function is also not working.
any help pls.....