Bug #17601 Updated: Stored Procedure Fetch Array
| From: | dwhitaker at dgsystems dot com | Date: | Mon, 24 Jun 2002 21:15:42 +0000 |
| Subject: | Bug #17601 Updated: Stored Procedure Fetch Array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11973@lists.php.net to get a copy of this message | ||
ID: 17601
Updated by: dwhitaker@dgsystems.com
Reported By: dwhitaker@dgsystems.com
Status: Open
Bug Type: Sybase-ct (ctlib) related
Operating System: Solaris
PHP Version: 4.1.2
New Comment:
We figured this out...
Basically the $db was already called earlier in the code... So here's
how to make the code work right...
$connection = @sybase_connect("server_name", "user", "pass")
or die("Couldn't connect to the server");
$db = @sybase_select_db("db_name", $connection)
or die("Couldn't select database.");
// here's the change take out the $db so it look like
$query = sybase_query("EXEC ops_select_mfr @mf_id=$mf_idx");
In Sybase once you connect to the database you can keep on truckin with
out calling it again... not sure that it was meant to be this way, but
it works...
Previous Comments:
------------------------------------------------------------------------
[2002-06-23 22:11:58] james.downie@visy.com.au
Try using sybase_fetch_row, but have to refer to the fields by numeric
cell references.
------------------------------------------------------------------------
[2002-06-04 17:37:22] dwhitaker@dgsystems.com
PHP 4.1.2
Solaris
Sybase
We are not able to return more than one row when doing a
sybase_fetch_array on a stored procedure.
Here is an example of my code:
$query = sybase_query("EXEC ops_select_mfr @mf_id=$mf_idx",$db);
while ($row = sybase_fetch_array($query)) {
$mf_id = $row['mf_id'];
$display .= "<tr><td>$mf_id</td></tr>";
}
This is echoed in a table, of course.
The first row is returned but nothing else.
We have checked our data using SQL Advantage so there are multiple
rows.
Does sybase_fetch_array work correctly? If so what are we doing wrong?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17601&edit=1