Re: [PHP] Stupid question

[email protected] (Daniel Brown)
Newsgroups php.general
Message-ID <CAD9cnePz2xaTJNAZnJ=2jJ4DNY1rh0BJmRXWyA+tuLmtiRH5zg@mail.gmail.com>
On Tue, Feb 26, 2013 at 4:27 PM, Curtis Maurand <[email protected]> wrote:
> I have the following:
>
> $dsn = "mysqli://$username:$password@$hostname2/$database";
> $options = array(
>     'debug' => 3,
>     'result_buffering' => false,
>   );
>   $dbh =& MDB2::factory($dsn, $options);
>         if (PEAR::isError($mdb2))
>         {
>                 die($mdb2->getMessage());
>         }
>
>
>
>
> function tallyCart($_u_id,$dbh){
>        while($row = $result->fetchrow(MDB2_FETCHMODE_ASSOC)) {
>                 $_showCheckOut=1;
>                 $_pdetail=new ProductDetail($row{'product_ID'},
> $row{'product_Quantity'}, $_u_id);
>                  $_getSubTotal += $_pdetail->_subTotal;
>                  $_counter++;
>         }
> }
>
> I'm getting:  Call to undefined method MDB2_Error::fetchrow()
>
> anyone have any ideas?  Can I not pass a database handle to a function?
>
> Thanks,
> Curtis

    Hate to answer a question with a question, but:

        1.) Do you have the PEAR package MDB2 installed?
        2.) Where is $result defined?  I don't see it in your code snippet here.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.