[PHP] RE: Possible bug? (was Re: [PHP] Arrays: Please help before I go insane?)

2002-06-06 Thread Scott Hurring
- > From: Chris Boget [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 06, 2002 4:43 PM > To: Scott Hurring; Php-General (E-mail) > Subject: Possible bug? (was Re: [PHP] Arrays: Please help before I go > insane?) > > > > In that case, split it up into two-steps,

[PHP] Possible bug? (was Re: [PHP] Arrays: Please help before I go insane?)

2002-06-06 Thread Chris Boget
> In that case, split it up into two-steps, to only init the > array if you need to i'm not really sure how the rest of > your code is -- you could probably do this a nicer way, > but this will work: > if (!is_array($ary["this"])) > $ary["this"] = array(); > $ary["this"]["that"] = 1; This is

RE: [PHP] Arrays: Please help before I go insane?

2002-06-06 Thread Scott Hurring
this"]["that"] = 1; --- Scott Hurring Systems Programmer EAC Corporation [EMAIL PROTECTED] Voice: 201-462-2149 Fax: 201-288-1515 > -Original Message- > From: Chris Boget [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 06, 2002 3:43 PM > To: Scott Hurring > Cc:

Re: [PHP] Arrays: Please help before I go insane?

2002-06-06 Thread Chris Boget
> Try: $ary["this"] = array("that" => 1); That works great until "this" has 2 children. The second child overwrites the first. :( Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Arrays: Please help before I go insane?

2002-06-06 Thread Scott Hurring
8 PM > To: PHP General > Subject: Re: [PHP] Arrays: Please help before I go insane? > > > > Now, what I'm trying to do is build a tree based on the > data in the DB. > > It's working relatively ok if I uncomment the code that is > on line 48 and > &g

Re: [PHP] Arrays: Please help before I go insane?

2002-06-06 Thread Chris Boget
> Now, what I'm trying to do is build a tree based on the data in the DB. > It's working relatively ok if I uncomment the code that is on line 48 and > comment out line 49. However, what I really want to do is build a fully > associative array doing this and now** an array that has string key

[PHP] Arrays: Please help before I go insane?

2002-06-06 Thread Chris Boget
To see what I'm working with, go here: http://www.melancholy.org/test_tree.php You may want to copy the source and the (mySQL) db structure and set it up on your system there to test it out. Though, if you don't want to do that, I show the output at the very bottom of the page. One note: I t