Help me to execute stored procedure with parameters using PHP ADODB, MSSQ.
$stmt = $db->PrepareSP('VM_SEARCH_SMSC');//stored procedure VM_SEARCH_SMSC
$search = 'test';
$string = 'SearchString';
$db->InParameter($stmt,$search,$string);
//return values.
$data = array();
$data['SNo'] = 0;
$data['SNSCID'] = 0;
$data['SMSCNAME'] = 0;
$data['MODE'] = '';
$data['ISACTIVE'] = 0;
$data['FIELD1'] = 0;
$data['ISBIND'] = 0;
$data['BNDOTHERRSRC'] = '';
$data['THRPT'] = '';
$db->OutParameter($statement, $data['SNo'], 'SNo');
$db->OutParameter($statement, $data['SNSCID'], 'SNSCID');
$db->OutParameter($statement, $data['SMSCNAME'], 'SMSCNAME');
$db->OutParameter($statement, $data['MODE'], 'MODE');
$db->OutParameter($statement, $data['ISACTIVE'], 'ISACTIVE');
$db->OutParameter($statement, $data['FIELD1'], 'FIELD1');
$db->OutParameter($statement, $data['ISBIND'], 'ISBIND');
$db->OutParameter($statement, $data['BNDOTHERRSRC'], 'BNDOTHERRSRC');
$db->OutParameter($statement, $data['THRPT'], 'THRPT');
$result = $db->Execute($stmt);
if (!$result){
print $db->ErrorMsg();
echo '<br /><br />';
}
Error:
SQLState: 42000 Error Code: 201 Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Procedure or function 'VM_SEARCH_SMSC' expects parameter '@SearchString', which was not supplied.
Somebody help me out
InParameter
and see if it is actually binding value or silently failing? – ughai May 1 at 6:27