note 105904 added to function.mssql-execute
| From: | ian_channing at hotmail dot com | Date: | Sat, 24 Sep 2011 14:05:32 +0000 |
| Subject: | note 105904 added to function.mssql-execute | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183402@lists.php.net to get a copy of this message | ||
Output parameters are cryptic to get out. Here's two examples, one if you have no results
returned from your stored procedure, one if you do have results returned:
<?php
/**
* using OUTPUT param with no results returned from stored procedure
*/
$outParamValue = 0;
mssql_bind($stmt, '@'.$outParamName, $outParamValue, $outParamType, $is_output = true);
mssql_execute($stmt, $skip_results = true);
/* N.B. If you don't use $skip_results = true you must use mssql_next_result as below **even if
there are no results returned from the stored procedure** */
echo($outParamValue);
/**
* using OUTPUT param with one result set returned from stored procedure
*/
$outParamValue = 0;
mssql_bind($stmt, '@'.$outParamName, $outParamValue, $outParamType, $is_output = true);
$result = mssql_execute($stmt, $skip_results = true);
echo($outParamValue); /* will still be 0 */
mssql_next_result($result); /* N.B. see the Note above about this */
echo($outParamValue); /* correct output */
?>
----
Server IP: 79.99.203.17
Probable Submitter: 109.132.169.40
----
Manual Page -- http://www.php.net/manual/en/function.mssql-execute.php
Edit -- https://master.php.net/note/edit/105904
Del: integrated -- https://master.php.net/note/delete/105904/integrated
Del: useless -- https://master.php.net/note/delete/105904/useless
Del: bad code -- https://master.php.net/note/delete/105904/bad+code
Del: spam -- https://master.php.net/note/delete/105904/spam
Del: non-english -- https://master.php.net/note/delete/105904/non-english
Del: in docs -- https://master.php.net/note/delete/105904/in+docs
Del: other reasons-- https://master.php.net/note/delete/105904
Reject -- https://master.php.net/note/reject/105904
Search -- https://master.php.net/manage/user-notes.php