I'm trying to create a custom language script in php and mysql. Basically how I have it now, Is I do two queries.... one I try selecting the language in the database. To see if any record for that page exists in the second language. If true the second sql statment will pull on that language id, if not, then it will pull on the default language id.
So I'm using this table:
id | page_id | language_id | page_meta_title | page_title | page_copy
Can I do a single query, ie, select distinct page_id value, where page_id = "current page id" & language_id = "current selected language"
if no value
select * from PAGES where page_id = "current page id" and language_id = 1
select * from PAGES where page_id = "current page id" and language_id = "current selected language"