note 75067 added to function.mssql-free-statement
| From: | fheald at obtainium dot org | Date: | Thu, 10 May 2007 16:48:06 +0000 |
| Subject: | note 75067 added to function.mssql-free-statement | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126393@lists.php.net to get a copy of this message | ||
I had the same issue - results from the second exec coming back blank if I didn't issue
mssql_free_statement after the first. (Standard php5 and sql server 2005).
...
$db = mssql_connect($host,$user,$pass);
$results = array();
$proc = mssql_init("usp_sel_MobileSummary", $db);
$PlayerID = '264882';
mssql_bind($proc, "@PlayerID", $PlayerID, SQLVARCHAR);
$sp_results = mssql_execute($proc);
$results = mssql_fetch_array($sp_results);
print "results 1:<br>\n";
print "<pre>\n";
print_r ($results);
print "</pre>\n";
#mssql_free_statement($proc);
#Try running it again immediately
$proc = mssql_init("usp_sel_MobileSummary");
$PlayerID = '264882';
mssql_bind($proc, "@PlayerID", $PlayerID, SQLVARCHAR);
$sp_results = mssql_execute($proc);
$results = mssql_fetch_array($sp_results);
print "results 2:<br>\n";
print "<pre>\n";
print_r ($results);
print "</pre>\n";
mssql_free_statement($proc);
-----
results 1:
Array
(
[0] => 80
[MobileNumberID] => 80
...
)
Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in
/var/www/html/fred/sp_test.php on line 26
Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in
/var/www/html/fred/sp_test.php on line 28
results 2:
----
Server IP: 69.39.81.135
Probable Submitter: 216.10.235.110
----
Manual Page -- http://www.php.net/manual/en/function.mssql-free-statement.php
Edit -- https://master.php.net/note/edit/75067
Del: integrated -- https://master.php.net/note/delete/75067/integrated
Del: useless -- https://master.php.net/note/delete/75067/useless
Del: bad code -- https://master.php.net/note/delete/75067/bad+code
Del: spam -- https://master.php.net/note/delete/75067/spam
Del: non-english -- https://master.php.net/note/delete/75067/non-english
Del: in docs -- https://master.php.net/note/delete/75067/in+docs
Del: other reasons-- https://master.php.net/note/delete/75067
Reject -- https://master.php.net/note/reject/75067
Search -- https://master.php.net/manage/user-notes.php