RE: [PHP] Arrays -- How do I insert a pair of data into an array

From: Date: Thu, 22 Feb 2001 22:20:12 +0000
Subject: RE: [PHP] Arrays -- How do I insert a pair of data into an array
Groups: php.general 
Request: Send a blank email to php-general+get-41224@lists.php.net to get a copy of this message
Try: echo $array[$i][course_num] . ' ' . $array[$i][course_title]; -jm -----Original Message----- From: Scott Walter [mailto:sdw1@geneseo.edu] Sent: Thursday, February 22, 2001 1:59 PM To: php-general@lists.php.net Subject: [PHP] Arrays -- How do I insert a pair of data into an array I am attempting to insert a set of data (actually a pair) into an array, without much success. I would like to insert the data set ("course number", "course title") into a numerically indexed array so that when I want to output the array I can reference it like so: echo("$array[$i]["course_num"] $array[$i]["course_title"]"); // where $i is just the index value that increments I tried building the array like so (where $tuple[....] is a valid result set from pg_fetch_row(): $array[] = array("course_num" => $tuple[crn], "course_title" => $tuple[course_name]); But all I gets outputted is: Array["course_num"] Array["course_title"] Any help with this would be greatly appreciated. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#41224) next »