Re: [PHP] Stupid question

[email protected] (Sebastian Krebs)
Newsgroups php.general
Message-ID <CALtuQzB9fpMxspo8OJHMd_abKDib78WMdE498nwgKop8i4AqRA@mail.gmail.com>
2013/2/27 tamouse mailing lists <[email protected]>

> On Tue, Feb 26, 2013 at 4:41 PM, Jim Lucas <[email protected]> wrote:
> > On 02/26/2013 01: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)) {
> >
> >
> > Talking in code.  The above two lines tell me...
> >
> > $dbh != $result
> >
> > isset($result) === false
> >
> >
> >
> >> $_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
> >>
> >>
> >
> >
> > --
> > Jim Lucas
> >
> > http://www.cmsws.com/
> > http://www.cmsws.com/examples/
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> Well, *I* have a stupid question: is $lhv =& expr the same as $lhv = &expr
> ??
>

Yes :) Because an operator "=&" doesn't exists, thus the lexer will split
them into the tokens "= &", or "= WHITESPACE &" respectively. The parser
again ignores whitespaces.


>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
github.com/KingCrunch
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.