maddogandnoriko Posted March 2, 2009 Share Posted March 2, 2009 I am building a tv database site and will eventually support multiple languages. My db has a table with non-language based info and another table that has a couple of language based rows(show description&title). What I need help with is the language row selection. I get the 'base info and left join the useres language info. Simple. But what I would like is: select base info left join language info(get users language info BUT if that doesn't exist use english info instead) Can this be done in one query? Thank you very much for ANY advice given Todd Quote Link to comment Share on other sites More sharing options...
phant0m Posted March 2, 2009 Share Posted March 2, 2009 Assuming you have to fetch information dependent on the user's language multiple times, I think it'd be wiser to store it in a variable, or even in the session and insert this in each query. Should put less stress on the database, also your queries will be shorter Quote Link to comment Share on other sites More sharing options...
maddogandnoriko Posted March 3, 2009 Author Share Posted March 3, 2009 The users info is stored in a session variable. I was not clear...I tend to do that. Say the spanish user is viewing the 'Lost' television show. If he wants to view episode 1 info I am now: query#1: getting episode 1 info that is the same for all languages, original airdate, rating, airtime etc. query #2: getting the info translated into spanish(title, description) what i want to do in 1 query is get the base episode info and the spanish description, but if the spanish description is empty, get the english description. Todd Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.