Answer the question
In order to leave comments, you need to log in
How to make a selection depending on the language?
I am making a multilingual resource and there is a translation table.
When fetching data, I use the following query:
SELECT * FROM `products_properties_translates` WHERE lang_id = '2' AND (`property_id` IN ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'));
Answer the question
In order to leave comments, you need to log in
'lang_id' IN (required, default) ORDER BY 'lang_id' DESC LIMIT 1
Default is assumed to be less than desired.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question