Jump to content


Photo

[SOLVED] PEAR Fatal: undefined method DB_Error::fetchInto()


  • Please log in to reply
1 reply to this topic

#1 c4onastick

c4onastick
  • Members
  • PipPipPip
  • Advanced Member
  • 216 posts

Posted 17 October 2006 - 12:11 AM

Problem with DB fetchInto():

<?php
        require_once('DB.php');
        $dsn = "mysql://user:password@localhost/price";
        $db =& DB::Connect( $dsn, array() );
        if(PEAR::isError($db)) {die($db->getMessage());}

        $ressy =& $db->query( "SELECT catid, cat FROM categories" );

        if( $ressy != null )
        {
                while($ressy->fetchInto($row))
                {
                        echo "<option value='".$row[0]."'>".$row[1]."</option>\n";
                }
        }
?>

Gives output of:
Fatal error: Call to undefined method DB_Error::fetchInto() in /home/brandon/public_html/test.php on line 11

It seems that others have had this problem too. I've had it before also, but I have no idea what I did that finally made it work. I literally copy/pasted this from code I have that does work, edited the query and the while loop. Anyone know the solution to this one? Thanks in advance!
Regex Tester::Unicode Regex::PHP Function List::MySQL 5.1
"Sorry sweetheart... but this all day sucker is down to the soggy white stick." -- Topper Harley

#2 c4onastick

c4onastick
  • Members
  • PipPipPip
  • Advanced Member
  • 216 posts

Posted 17 October 2006 - 03:56 AM

SOLVED. I accidentally mistyped one of the table names, which apparently causes fetchInto to fail.
Regex Tester::Unicode Regex::PHP Function List::MySQL 5.1
"Sorry sweetheart... but this all day sucker is down to the soggy white stick." -- Topper Harley




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users