FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18473&edit=1

ID: 18473
Updated by: l.alberton@quipo.it
Reported By: aswatts at gmail dot com
Summary: MDB2_FETCHMODE_ASSOC does not work with mssql driver
Status: Open
Type: Bug
Package: MDB2
Operating System: Linux
Package Version: 2.5.0b3
PHP Version: 5.3.1
Roadmap Versions:
New Comment:

You're missing quotes in your array key:

$tarr['test_var'];


Also, depending on the portability options, the index name might be in a
different
case. Verify the contents of the resultset by doing

print_r($tarr);


Previous Comments:
------------------------------------------------------------------------

[2011-04-21 22:33:58] a21wat

Description:
------------
When setting the fetchmode:

while ($tarr = $tresult->fetchRow(MDB2_FETCHMODE_ASSOC)){
echo $tarr[test_var];
}

php generates error: PHP Notice: Undefined index: test_var in .....

tried to set fetchmode after connection using:
$db3->setFetchMode(MDB2_FETCHMODE_ASSOC) to no avail.

Only MDB2_FETCHMODE_DEFAULT works

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at Apr 22, 2011 at 12:43 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18473&edit=1

    ID: 18473
    Updated by: daniel.oconnor@gmail.com
    Reported By: aswatts at gmail dot com
    Summary: MDB2_FETCHMODE_ASSOC does not work with mssql driver
    -Status: Open
    +Status: Feedback
    Type: Bug
    Package: MDB2
    Operating System: Linux
    Package Version: 2.5.0b3
    PHP Version: 5.3.1
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Feedback



    Previous Comments:
    ------------------------------------------------------------------------

    [2011-04-21 22:45:57] quipo

    You're missing quotes in your array key:

    $tarr['test_var'];


    Also, depending on the portability options, the index name might be in a
    different
    case. Verify the contents of the resultset by doing

    print_r($tarr);

    ------------------------------------------------------------------------

    [2011-04-21 22:33:58] a21wat

    Description:
    ------------
    When setting the fetchmode:

    while ($tarr = $tresult->fetchRow(MDB2_FETCHMODE_ASSOC)){
    echo $tarr[test_var];
    }

    php generates error: PHP Notice: Undefined index: test_var in .....

    tried to set fetchmode after connection using:
    $db3->setFetchMode(MDB2_FETCHMODE_ASSOC) to no avail.

    Only MDB2_FETCHMODE_DEFAULT works

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedApr 21, '11 at 9:44p
activeApr 22, '11 at 12:43a
posts2
users2
websitepear.php.net

2 users in discussion

Daniel Oconnor: 1 post L Alberton: 1 post

People

Translate

site design / logo © 2022 Grokbase