Let me explain what I have:
I got website where the suer can select a language. This language is put into a sessionvariable and made global so it can be used through the entire site.
First I added a field called: "language" to each row in the database, so if a newsarticle was meant for spanish people, I could select all news for spanish people like this:
SELECT * FROM news WHERE language='spanish';
Something like that.
But I decided to do it different, cuz this website has to work with loads of products and newsitems including an image. Instead of adding every same newsitem for every language (5 languages) I add it once, in all languages. Why? Because then I only have to attach one image to the news/product, which saves a lot of space on webserver on long terms.
But now comes my problem,.. I got this sessionvar which tells the language.
I can do it the long way: making SELECT statements for every language, which will get me a lot of work on my sleeve, and I'm running out of time.
I can do it the short way: In the output of the var I got this:
$query=mysql_query("SELECT * FROM jobs LIMIT $start,$end");
while($job=mysql_fetch_array($query))
{
singleRow_l("<a href=\"index.php?site=jobs/show_job.php&id=$job[job_id]\" title=\""._SHOW." ".htmlspecialchars($job['titel'])."\">".htmlspecialchars($job['titel'])."</a>\n");
}
(singleRow is some function of my template, it makes a tablerow outlined left)
In the database I got fields which are setup like this:
tekst_nl
tekst_sp
tekst_en
etc. so an underscore followed by the languagecode.
Now my question is: how can I add the variable to the output in my table, so what I want to do is this:
$row['title_$language']
That way I can win a lot of time, but this doesn't work. Anyone ideas on it?