#46609 [Opn->Bgs]: can't read out the result from a mssql stored procedure
| From: | kalle@php.net | Date: | Tue, 03 Mar 2009 05:32:56 +0000 |
| Subject: | #46609 [Opn->Bgs]: can't read out the result from a mssql stored procedure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-134361@lists.php.net to get a copy of this message | ||
ID: 46609
Updated by: kalle@php.net
Reported By: gyula dot fekete at different dot hu
-Status: Open
+Status: Bogus
Bug Type: MSSQL related
Operating System: Linux
PHP Version: 5.2.6
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2008-11-19 09:17:01] gyula dot fekete at different dot hu
Description:
------------
Hello,
I connect to a MSSQL server and run a stored procedure, but I can't
read out the result of the query in that sp. I use the
mssql_init,mssql_bind,mssql_execute functions like I saw on PHP.net, but
it does not work. The stored procedure runs correctly, without any
error, and it should return values, becouse I tested it in SQL Server
Man. Studio whit the same parameters.
Reproduce code:
---------------
include("dbconn.php");
$from = 26;
$to = 28;
$dfrom = '20080101';
$dto = '20080331';
$stmt=mssql_init("FokonyvKartonLista", $conn);
mssql_bind($stmt, "@FszamTol", $from, SQLINT4);
mssql_bind($stmt, "@FszamIg", $to, SQLINT4);
mssql_bind($stmt, "@DatumTol", $dfrom, SQLCHAR);
mssql_bind($stmt, "@DatumIg", $dto, SQLCHAR);
$r=mssql_execute($stmt);
var_dump($r);
if (!$r){
$message = "Last message from SQL : " . mssql_get_last_message()
."";
echo $message;
}
while ($s = mssql_fetch_row($r)) {
echo "Row: ".$s[0]."<br />";
}
// OR
/*
do {
while ($s = mssql_fetch_row($r)) {
echo "Row: ".$s[0]."<br />";
}
}
while(mssql_next_result($r));
*/
mssql_free_result($r);
mssql_close($conn);
Expected result:
----------------
I expect the returnd rows of the query in the stored procedure.
The result of var_dump($r) is:
resource(5) of type (mssql result)
What does this mean?
Actual result:
--------------
No result
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46609&edit=1