note 75067 rejected from function.mssql-free-statement by nlopess
| From: | nlopess@php.net | Date: | Sat, 12 May 2007 11:27:19 +0000 |
| Subject: | note 75067 rejected from function.mssql-free-statement by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126442@lists.php.net to get a copy of this message | ||
Note Submitter: fheald at obtainium dot org
----
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: