Re: DB stuff
| From: | Brian Moon | Date: | Thu, 05 Apr 2001 22:29:46 +0000 |
| Subject: | Re: DB stuff | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-173@lists.php.net to get a copy of this message | ||
on 4/5/01 5:59 PM, Robert Kelly at rkelly@Insight.com wrote:
>
>
>
>
> WHOA!
>
>> return (object)$arr;
>
> Where's that documented? MY GOD, MAN! MY LIFE COULD HAVE BEEN SO EASY :)
>
> -B
>
>
> -----Original Message-----
> From: Joao Prado Maia [mailto:jpm@phpbrasil.com]
> Sent: Monday, March 26, 2001 1:07 PM
> To: pear-dev@lists.php.net
> Subject: Re: [PEAR-DEV] DB stuff
>
>
>
> On Sun, 25 Mar 2001, Colin Viebrock wrote:
>
>> While we are at it, can we add this to DB_result:
>>
>> function fetchObject($fetchmode = DB_FETCHMODE_DEFAULT)
>> {
>> $res = $this->fetchInto ($arr, $fetchmode);
>> if (is_object($res)) {
>> return $res;
>> }
>> return (object)$arr;
>> }
>>
>> I've been missing mysql_fetch_object since switching to PEAR. :)
>>
>
> What about this ?
>
> $data = (object) $dbh->fetchRow($result, DB_FETCHMODE_ASSOC);
>
> Adding a new function that does the same thing as this simple line is just
> ridiculous. Am I missing something here ?
>
> Joao
>
> --
> João Prado Maia <jpm@phpbrasil.com>
> http://phpbrasil.com - php com um jeitinho brasileiro
> --
> Contribua com o projeto de tradução do manual online do PHP
> http://phpbrasil.com/traducao.php
> --
>
http://php.net/manual/en/language.types.type-juggling.php
Brian.