Jump to content

selecting table rows


maddogandnoriko

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/147653-selecting-table-rows/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/147653-selecting-table-rows/#findComment-775158
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.