Re: [PHP] Stupid question

[email protected] (Serge Fonville)
Newsgroups php.general
Message-ID <CAOAS_+JYUWM6xwP1zgrYeP4=nRe9HzCxPs_dneF+mzmGUsCnFA@mail.gmail.com>
Hi,

I'm getting:  Call to undefined method MDB2_Error::fetchrow()

Have your checked if $dbh->query() throws an error?
It seems $result is a different type than expected.

HTH

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table


2013/2/26 Curtis Maurand <[email protected]>

> On 2/26/2013 4:33 PM, Daniel Brown wrote:
>
>> 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.
>>
>>  Sorry,
>
>         $myquery  = "SELECT * from tbl_Cart where u_ID='$_u_id'";
>         echo $myquery;
>         $result =& $dbh->query($myquery);
>
> I then tried setting the buffering to true and did a if($result->numrows()
> >0) and wrapped it around the entire fetchrow loop and I still get the same
> thing.
>
> I just took a look and the libraries are installed if not a bit outdated,
> but they are there.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
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.