IIRC, using it that way is only safe if you are absolutely certain that 
all of the rows have been fetched.  I'm fairly certain it's not safe if 
they haven't.

With the syntax you have there, it is not apparent that you are even 
fetching your rows at all. In that case, $sth->rows will not be reliable 
either.



____________________________
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
____________________________





[EMAIL PROTECTED]
10/02/2003 02:57 AM

 
        To:     [EMAIL PROTECTED]
        cc: 
        Subject:        sth finish implicitly on next calls?


Does resuing a $sth for another call w/o explictily calling $sth->finish
causes any problem? This is because sometime I like to take a shortcut in
codes.

from this
 { ...
  $sth=&getUser("bob");
  $x = $sth->rows();
  $sth->finish;
  return $x;
 }

to this
 { ...
  $sth=&getUser("bob);
  return $sth->rows();
 }

or even this
 { ...
  return &getUser("bob")->rows();
 }

Any danger here?
thanks,
-rkl



Reply via email to