Checking if value exists in SQL and if not returning another row
I have a MySQL SQL query that selects products and the text translations:

    SELECT *
    FROM (select * from products) p
    LEFT JOIN (SELECT * FROM translations) t
    ON t.id = p.product_id

This grabs the products from the database. However it grabs all the available translations. I just want to get the translations in the current language. So i can use this:

    SELECT *
    FROM (select * from products) p
    LEFT JOIN (SELECT * FROM translations WHERE lang = 'en') t
    ON t.id = p.product_id

This works as intended, however not all products have a translation for every language. What I ultimately want to do is specify a language and if there is no given translation then return whatever other translations we have. Can this be done in SQL or am i going to need to iterate through the results in PHP?
Checking if value exists in SQL and if not returning another row
===

I have a MySQL SQL query that selects products and the text translations:

    SELECT *
    FROM (select * from products) p
    LEFT JOIN (SELECT * FROM translations) t
    ON t.id = p.product_id

This grabs the products from the database. However it grabs all the available translations. I just want to get the translations in the current language. So i can use this:

    SELECT *
    FROM (select * from products) p
    LEFT JOIN (SELECT * FROM translations WHERE lang = 'en') t
    ON t.id = p.product_id

This works as intended, however not all products have a translation for every language. What I ultimately want to do is specify a language and if there is no given translation then return whatever other translations we have. Can this be done in SQL or am i going to need to iterate through the results in PHP?