MSSQL store proc and invalid result source
| From: | Hien Nguyen | Date: | Tue, 22 Oct 2002 15:49:13 +0000 |
| Subject: | MSSQL store proc and invalid result source | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-22578@lists.php.net to get a copy of this message | ||
I am using a MSSQL stored procedure that is a select
on a table. It works fine in an ASP app. And in Query
Analyzer.
However, in PHP it works fine unless the select
returns zero rows. When 0 rows are returned I get an
invalid result source.
In the sample code below I will get an error when I
fetch the row because the result source that is
returned from the stored procedure is invalid, but
only when the result set is empty.
$stmt=mssql_init("spMyProc");
mssql_bind($stmt,"@param1",$var1,SQLINT4,false,false,4);
mssql_bind($stmt,"@param2",$var2,SQLINT4,false,false,4);$result
$result = mssql_execute($stmt);
while ($row=mssql_fetch_array($result)) {
}
I would appreciate any help or leads. Thank you.
Hien Nguyen
Rutgers Campus Information Services
hqnguyen77@yahoo.com
__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/