Re: Creating an array as a property of an object
| From: | Robert Cummings | Date: | Fri, 26 Jan 2007 21:08:27 +0000 |
| Subject: | Re: Creating an array as a property of an object | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247855@lists.php.net to get a copy of this message | ||
On Fri, 2007-01-26 at 15:09 -0600, Ken Kixmoeller -- reply to
ken@kixmoeller.com wrote:
> Hello, folks -- lurking for a while, first post --
>
> I'm relatively new to PHP but doing database design work for nearly
> 20 years.
>
> I've RTFM'ed (+ books + other resources) a bunch of times but I have
> a mental block around doing this:
>
> I want to have an multidimensional array as a property of an object.
>
> Example:
>
> MySQL Resource:
> WHAM_ID NAME AMOUNT
> 5 Fred 99
> 9 Albert 345
> 23 Mary 5
> (etc...)
>
> Inside the function which builds the instance of the object, I have
> language like:
>
> while ($line = mysql_fetch_array($result_set,MYSQL_ASSOC))
> {
> $this->foom_array =
> array("MyKey".$line["wham_id"]=>array($line).",";
$this->foom_array[$line['WHAM_ID']] = $line;
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'