I am using php to consume a mssql stored procedure, my code works with other stored procs but when I try returning something from this one it just returns bool(false) and not the selected value.
$para = array(array($this->Forename), array($this->Surname), );
$result = mssqldb::query("{call usp_NewCustToOrderRemote(?,?)}", $para);
$userid = sqlsrv_fetch_array($result); var_dump($userid);
The stored proc basically just inserts the parameters and then selects the new row id
set @newID = @@IDENTITY
select @newID
I have no control over the stored procedures so I can’t add a return value.
When I run the stored proc in management tools it runs fine, when I run in php the row is created.
Oh my db connector class is not using mssql but sqlsrv it’s just named incorrectly.
I am I missing something really obvious?
As my stored procedure updated a row and then returned the ‘select’ I had to use go to the next result as the first result was the row updated.
I did add validation as well 🙂