sybase_fetch_array and sybase_fetch_row not working
| From: | Joey | Date: | Wed, 07 Jul 1999 18:10:51 +0000 |
| Subject: | sybase_fetch_array and sybase_fetch_row not working | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1922@lists.php.net to get a copy of this message | ||
Compiled CGI --with-sybase on a Sun Ultra/10 (Solaris 2.6).
Works:
sybase_connect
sybase_pconnect
(No idea how to tell whether connection is truly persistent, tho')
sybase_query
sybase_num_rows
could not get sybase_fetch_array or sybase_fetch_row to work...
Example script:
<?
$q = sybase_query(" SELECT distinct OPPORTUNITY_ID as O ,
VOLUNTEER_ID as V
FROM M_PLACEMENTS m where DOWNLOADED = 0
AND m.OPPORTUNITY_ID in
(SELECT OPPORTUNITY_ID FROM OPPORTUNITY)",
$db)
or die("Query \$q failed!\n");
$num = sybase_num_rows($q);
echo "Number of rows = $num\n";
while ($a = sybase_fetch_row($q)) {
while(list( $k, $v ) = each($a)) {
echo "\$a[$k] => $v\n";
}
echo "\$a = " . $a["O"] . "\n";
/* Nothing...try some other things */
$opp_id = $a["O"];
echo "$opp_id\n\n";
?>
Returns:
Number of rows = 1477
$a[0] =>
$a[1] =>
I'm not sure if it works --with-apache...Though I can't see how that would
really matter...
Still cannot get linux version to connect. If anyone has any ideas on how
I could go about debugging / figuring out WHY that doesn't work, please
let me know. I'm really anxious to compare speed between 3 & 4.
Also, does the debugger work in PHP4?
--Joey Smith