Pear DB fails to return Records

From: Date: Tue, 15 Jun 2004 16:09:43 +0000
Subject: Pear DB fails to return Records
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13170@lists.php.net to get a copy of this message
Help! I have installed a new version of PHP (4.3.7) and the latest PEAR:DB (1.6.4) and find my database (mssql using freetds-0.62.3) code no longer returns records and does not report an error. Anyone have an idea of what is wrong? This is running on an IBM Z-series with suse linux (2.4.19-3suse-SMP #1 SMP Wed Nov 6 22:20:51 UTC 2002 s390x ). Any ideas on what might be wrong? Thanks, Conrad Gratz Here is some test code: <?php require_once 'DB.php'; require('oie/setup.php'); require('oie/oie.php'); PEAR::setErrorHandling(PEAR_ERROR_PRINT); connect_OIE($oiedb); $info = $oiedb->tableInfo('system_users'); print_r($info); echo("*************************************************\n"); ?> Here are the results from the new non-working install of PHP-Pear:DB: DB Error: unknown errordb_error Object (
    [error_message_prefix] =>
    [mode] => 2
    [level] => 1024
    [code] => -1
    [message] => DB Error: unknown error
    [userinfo] =>  [nativecode=-20 - Changed database context to 'oierpt'.]
    [backtrace] => Array
        (
            [0] => Array
                (
                    [file] => /usr/local/lib/php/DB.php
                    [line] => 748
                    [function] => pear_error
                    [class] => db_error
                    [type] => ->
                    [args] => Array
                        (
                            [0] => DB Error: unknown error
                            [1] => -1
                            [2] => 2
                            [3] =>
                            [4] =>  [nativecode=-20 - Changed database context to 'oierpt'.]
                        )
                )
            [1] => Array
                (
                    [file] => /usr/local/lib/php/PEAR.php
                    [line] => 536
                    [function] => db_error
                    [class] => db_error
                    [type] => ->
                    [args] => Array
                        (
                            [0] => -1
                            [1] => 2
                            [2] =>
                            [3] =>  [nativecode=-20 - Changed database context to 'oierpt'.]
                        )
                )
            [2] => Array
                (
                    [file] => /usr/local/lib/php/DB/common.php
                    [line] => 500
                    [function] => raiseerror
                    [class] => pear
                    [type] => ::
                    [args] => Array
                        (
                            [0] =>
                            [1] => -1
                            [2] =>
                            [3] =>
                            [4] =>  [nativecode=-20 - Changed database context to 'oierpt'.]
                            [5] => DB_Error
                            [6] => 1
                        )
                )
            [3] => Array
                (
                    [file] => /usr/local/lib/php/DB/mssql.php
                    [line] => 492
                    [function] => raiseerror
                    [class] => db_mssql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => -1
                            [1] =>
                            [2] =>
                            [3] =>
                            [4] => -20 - Changed database context to 'oierpt'.
                        )
                )
            [4] => Array
                (
                    [file] => /usr/local/lib/php/DB/mssql.php
                    [line] => 544
                    [function] => mssqlraiseerror
                    [class] => db_mssql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => -20
                        )
                )
            [5] => Array
                (
                    [file] => /usr/local/apache/htdocs/oieapp/test.php
                    [line] => 11
                    [function] => tableinfo
                    [class] => db_mssql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => system_users
                        )
                )
        )
    [callback] =>
) ************************************************* And here are results from the old working system using Pear:DB 1.5.0RC1: Array (
    [0] => Array
        (
            [table] => system_users
            [name] => first_name
            [type] => char
            [len] => 20
            [flags] =>
        )
    [1] => Array
        (
            [table] => system_users
            [name] => last_name
            [type] => char
            [len] => 30
            [flags] =>
        )
    [2] => Array
        (
            [table] => system_users
            [name] => user_id
            [type] => char
            [len] => 40
            [flags] =>
        )
    [3] => Array
        (
            [table] => system_users
            [name] => sysadmin
            [type] => char
            [len] => 1
            [flags] =>
        )
    [4] => Array
        (
            [table] => system_users
            [name] => staff
            [type] => char
            [len] => 1
            [flags] =>
        )
    [5] => Array
        (
            [table] => system_users
            [name] => student
            [type] => char
            [len] => 1
            [flags] =>
        )
    [6] => Array
        (
            [table] => system_users
            [name] => prg_coordinator
            [type] => char
            [len] => 1
            [flags] =>
        )
    [7] => Array
        (
            [table] => system_users
            [name] => prg_administrator
            [type] => char
            [len] => 1
            [flags] =>
        )
    [8] => Array
        (
            [table] => system_users
            [name] => inactive
            [type] => char
            [len] => 1
            [flags] =>
        )
) ************************************************* Other notes: Freetds returns records. The new system appears to be making connections. It returns appropriate error messages when I try and execute SQL in which I have placed an error.

« previous php.pear.general (#13170) next »