Re: [PHP4BETA] sybase_fetch_array and sybase_fetch_row not working

From: Date: Thu, 08 Jul 1999 14:59:43 +0000
Subject: Re: [PHP4BETA] sybase_fetch_array and sybase_fetch_row not working
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-1925@lists.php.net to get a copy of this message
The Sybase module doesn't use the array abstraction layer (macros) and, thus, it's broken in PHP 4.0. Lines like:
        pval_copy_constructor(&field_content);
        _php3_hash_index_update(return_value->value.ht, i, (void *) &field_content, sizeof(pval),NULL);
from the fetch_row implementation need to be substituted with the add_index_* functions from zend_API.h Andi At 12:10 PM 7/7/99 -0600, Joey wrote:
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
-- PHP 4 Beta
--- Andi Gutmans <andi@zend.com> ICQ: 1568297

« previous php.version4 (#1925) next »