Re: Suggestion for fetchInto

From: Date: Sat, 21 Apr 2001 11:21:40 +0000
Subject: Re: Suggestion for fetchInto
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-284@lists.php.net to get a copy of this message
"Tomas V.V.Cox" wrote: > > > Do you think that someone would change to Pear DB if he must to do that > (the absolute correct way I can think): > > do { > $err = $res->fetchInto($row, DB_FETCHMODE_ASSOC); > if ($err === DB_OK) { > $name = $row['name']; > ... > } > } while ($err === DB_OK); > if (DB::isError($err)) { > die ($err->getMessage()); > } > > ? Okey, there is another shorter but still obscure method: while (DB_OK === ($err = $res->fetchInto($row, DB_FETCHMODE_ASSOC))) { } if (DB::isError ($err)) { .... } Tomas V.V.Cox

« previous php.pear.dev (#284) next »