|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29316 Executing Stored Procedure with more than one Resultset
Submitted: 2004-07-22 10:35 UTC Modified: 2005-11-18 22:25 UTC
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: patrick dot schutte at gmx dot de Assigned: fmk (profile)
Status: Closed Package: MSSQL related
PHP Version: 5CVS-2005-03-08 OS: Suse8.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: patrick dot schutte at gmx dot de
New email:
PHP Version: OS:


 [2004-07-22 10:35 UTC] patrick dot schutte at gmx dot de
I've written stored Procedures that returns 2 and more Resultsets (Select-Querys). If one of theese Results doesn't have any Matches I get the next one instead.
System: Suse8.2, freetds 0.62.3 ./configure ... --with-mssql
freetds with TDS-Version 7.0 and MSSQL-Server2000. Same Code works fine with WindowsNT4.0

Reproduce code:
CREATE PROCEDURE [dbo].[dt_mehrfach] AS
	-- first Query: no match
	SELECT * FROM tbl_haribo
	WHERE id=10000
	-- second Query: 15 matches
	SELECT * FROM tbl_haribo
echo mssql_num_rows($result)."<br />\n";
echo mssql_num_rows($result);

Expected result:
would be ok

Actual result:
but  I get 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 20:51 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-03-08 13:51 UTC] patrick dot schutte at gmx dot de
nope, Im using php 5.1.0-dev 200508030930 with freetds 0.62.4.
The stored procedure executes 2 Select-Statements. The frist with no result, the second with 5 lines.
On tsql-console from freetds:
1> use php
2> go
1> exec dbo.dt_mehrfach
2> go
id      produktname     tagesbedarf     kvnr
id      produktname     tagesbedarf     kvnr
17      Schnecken       1 T?ten / Tag   2135860009
18      Colorado        1 T?te / Monat  NULL
19      Gummib?rchen    2 T?ten / tgl.  NULL
20      Test            NULL
16      Phantasia       12 T?ten / Woche        NULL
(return status = 0)
the first line "id      produktname     tagesbedarf     kvnr" show no matches for the first select.

echo "Select1: ".mssql_num_rows($rs);
echo "Select2: ".mssql_num_rows($rs);
instead 0,5 still after updating php with latetst snap.
The Problem still exists.
 [2005-08-09 11:23 UTC] freddyz77 at tin dot it
Using FreeTDS 0.63 with post fix and current version works correctly. Tried also 0.64 (current developing version)

 [2005-11-18 22:25 UTC]
This works with the development version of FreeTDS
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 15 01:01:29 2024 UTC