Do you have a question? Post it now! No Registration Necessary. Now with pictures!
September 17, 2009, 7:33 pm
rate this thread
I have a need to access the boolean return value of a MSSQL stored
procedure and cannot find the process to do so with ODBC, if even
possible. Searching around the Internet, i've seen some instruction on
accomplishing it with the mssql extension, but since I'm more
familiar with the ODBC extension I've started there first.
Rewriting the SP to return the value as a rowset is not an option, as
it is a built-in ASP.NET procedure. I suppose the SP could be
wrapped in another SP that returns a rowset as a workaround.
$app = 'app';
$uname = 'user';
$role = 'role';
$conn = odbc_connect('DSN','user','pass');
$stmt = odbc_prepare($conn,
$result = odbc_execute($stmt, array($app,$uname,$role);
Here, $result is bound as a resultset resource. Is there another
way to bind a PHP variable to the SP's return value?
If this cannot be done with PHP's ODBC, I can focus my efforts on
learning php-mssql instead. Thanks for your input.