|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-04 17:37 UTC] dwhitaker at dgsystems dot 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?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
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...