I am trying to execute following query, but it provides a syntax error which i couldn't find. Appreciate your help to resolve the issue.
Error
Array ( [0] => Array ( [0] => 07002 [SQLSTATE] => 07002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver 17 for SQL Server]COUNT field incorrect or syntax error [message] => [Microsoft][ODBC Driver 17 for SQL Server]COUNT field incorrect or syntax error ) )
<?php
session_start();
require_once '../../../config/dbconfig.php';
$sql = "EXEC smeProBizInspecInsert
@strLeadRefNo = ? ,
@strCustName = ? ,
@strEnteredBy = ? ,
@dtmEnteredDate = '',
@strInspectStatus = 'SMS06',
@strBranch = ? ";
$stmt=sqlsrv_prepare($conn,$sql,array(&$_POST['strLeadRefNo'],&$_POST['customerName'],&$_SESSION['NAME'], &$_SESSION['BRANCH']));
sqlsrv_execute($stmt);
$stmt = sqlsrv_prepare($conn, $sql);
if (!sqlsrv_execute($stmt)) {die( print_r( sqlsrv_errors(), true) );}
else {echo json_encode("success");}
?>
&to them? Is that something in a query as such that I don't know about? Far as I remember, single ampersands are bitwise characters.