[FX.php List] Using one query to feed another

DC dan.cynosure at dbmscan.com
Tue Oct 18 12:59:15 MDT 2005

you're saying you want to be able to present your field names in a 
user-chosen language regardless of what they are named in your database 

cookies would be a good way for you to store a key to each user's choice 
for language. use a key to a table in a "multi-lingual fieldnames" 
database rather than storing the actual fields in the cookie.

then, starting each session, check the cookie and pull the names from 
the multi-lingual fieldnames database.

your database would hold the field names rendered in each language and a 
language id field to identify which language from the languages table 
(all in tables arranged in proper relational structure, hopefully).

something simple like:
one language record to many fieldnames records

then your process goes: get key from user cookie, use key in find 
request, pull results into array for use in your fieldname headings.


Glenn Singleton had written:
> Hi
> I want to store the "headings" for my fields in a lookup table and  
> reference that table every time I lookup data.
> So pseudo code might be :
> $heading_type = "technical"    ; or "simple" or "crazy" -- these are  
> the fields for the lookup table
> $rec_id = 5;                                ; this is the record for  
> which we wish to display the data
> $data = find[for $rec_id]            ; our data array
> echo "Here is your data referred to in ".$heading_type." format";
> for each field
>      $head = find[  $data[field name] ]  ; find field name record in  
> heading lookup table
>     echo $head[data]." --- ".$data[data]   ;present the data to the  
> user in their format
> endfor
> I will know this "heading_type" from a logon screen when the user  first 
> enters the system and there are say 100 records in the  "headings" 
> lookup table,
> is there a way to store these, say in a cookie??? (I only know the  
> terminology, not how to do it) to save this 2nd lookup for every  field 
> in the main database ?
> Thanks for any help and I hope my pseudo code is not too confusing
> By the way, the real use for this is to create a multi-lingual web  
> interface as part of the "infocenter" project www.infocntr.net ,  we  
> will be releasing all fm and php source code with no passwords under  a 
> GPL type license agreement.
> Regards
> Glenn Singleton
> "The Infocenter Project "
> www.infocntr.net
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

More information about the FX.php_List mailing list