Re: Need help with this array

From: Date: Mon, 21 Apr 2003 19:48:55 +0000
Subject: Re: Need help with this array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144705@lists.php.net to get a copy of this message
Charles Kline wrote:
I have an array which is created (perhaps incorrectly?) like this: $default_peeps = array(); while ($peeps_row = $peeps_result->fetchRow(DB_FETCHMODE_ASSOC)){
Try this instead: $default_peeps[$peeps_row['person_id']] =$peeps_row['is_primary']; or this: $default_peeps[] =array($peeps_row['person_id'], $peeps_row['is_primary']); print_r() will tell you what it contains now.
} When I print_r() the array I get this: Array ( [0] => 1649815377 [1] => Array ( [0] => N ) [2] => 890812244 [3] => Array ( [0] => N ) [4] => -408244191 [5] => Array ( [0] => Y ) ) I am able to get the first value (person_id) like this: echo $default_peeps[0]; But I am not sure how to get the other part (N) for that person - the value of is_primary Thanks for any pointers. charles


« previous php.general (#144705) next »