My objective is to create a multi-language web site. At first, I plan to have only 3 languages (French, German, and English).
The welcome page will be displayed in English and then next pages will be localized thanks to a variable carried through a php session.
I created a table page2 with the following columns:
Field_name | English | German | French
Table contains:
Name | "Your name" | "Ihre Name" | "Votre nom"
Street | "Streetname" | "Ihre Strasse" | "Votre rue"
...
php code:
$sql = "SELECT * FROM page2;";
$result = mysql_query($sql);
I want to display the table contents (in several parts of the page) in the appropriate language.
If in English: Your name: Smith (value retrieved from another table - not the question here!)
If in German: Ihre Name: Smith (value retrieved from another table - not the question here!)
My question is how to have "Your name" or "Ihre Name" or "Votre nom" such as:
echo $result['Name'][column=$lang];
Display "English" column value of row "Name" if English is set in $lang
Display "German" column value of row "Name" if German is set in $lang