Try: 

echo $array[$i][course_num] . ' ' . $array[$i][course_title];

-jm

-----Original Message-----
From: Scott Walter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 1:59 PM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to