I have a multi-dimensional array. Looks like this:

$work_order_hdr = array ('whdr_id'=>'record_no',
                         'whdr_order_no'=>'request_no',
                         'whdr_site_id'=>'site_id',
                         'whdr_user_id'=>'user_id',
                         'whdr_location'=>'location',
                         'whdr_date_submitted'=>'date_submitted',
                         'whdr_date_acknowledged'=>'date_acknowledged',
                         'whdr_date_approved'=>'date_approved',
                         'whdr_date_rejected'=>'date_rejected',
                         'whdr_date_cancelled'=>'date_cancelled',
                         'whdr_date_closed'=>'date_closed',
                         'whdr_status'=>'status');

$work_order_hdr['links']['whdr_site_id']='site_master["site_id"]';
$work_order_hdr['links']['whdr_user_id']='user_master["user_id"]';

I use the a part of the array to display the field names from the db in a more
user-friendly manner.  The 'links' part is new and is intended to link certain
fields to fields in other tables.

I have a variable called '$tbl' that contains a table name, in this case
$tbl='work_order_hdr'. I can reference 'whdr_id' like this:

echo $$tbl['whdr_id']

That gives the expected 'record_no'

I can't seem to access the links correctly. I've tried various combinations of
'isset' and 'array_key_exists' but can't find the correct syntax.

The system in question is running php 4.1.2. Suggestions?

-- 
Jim Kaufman             mailto:[EMAIL PROTECTED]
Linux Evangelist        cell: 612-481-9778              
public key 0x6D802619   fax:  952-937-9832
http://www.linuxforbusiness.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to