I think I’d use a separate row based on key_id and language_code, and just return the text, rather than trying to store the text for each language in the same row. It would obviate the need to alter the table layout when you decide to add support for an extra language, too.
To clarify, i only want to query the record once and retrieve all the data from tx_“.$lang.”
Throughout the pages, the tx_“.$lang.” will be dotted around the here and there, so echo tx_“.$lang.” with id=17 here and echo tx_“.$lang.” with id 45 there etc etc
OK, if that’s your preference. Either way is possible, simply use the language code to build your query when retrieving the text. Might make it slightly more readable to use the “as” modifier, as in “select keyid, text_$lang as text” so when you use the text, that can always be the same.
Of course. I just figured it would be easier to add the data into an existing table rather than adding another column and having to change the layout. Also would get around the issue above as you’d just be doing “select keyid, text where keyid=x and langcode=y”, returned text would always have the same name.
Itll take 2 seconds to add another column, and as i created a dynamic cms, all form fields to add data are created on the fly, so i don’t understand your point…and similarly i don’t understand this response against my inital question