Perhaps he could share all relevant code, since at this time we are mostly guessing. Declaration/assignment of a lot of variables isn't included in the snippets. 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/27 Jim Giner <jim.giner@xxxxxxxxxxxxxxxxxx> > On 2/26/2013 4:27 PM, Curtis Maurand 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 >> >> > This may be that stupid answer, but I see what appears to be two problems. > > 1 - $result is not declared globally in your function header, so hence > it's undefined, hence all of its methods are. > > 2 - you have a couple indices wrapped in curly braces, not parens. Is > that some new kind of syntax I'm not aware of? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >