Posted by FatCoin on 11/17/05 15:26
!!!CORECTION !!!
> Hi,
>
ADD id_entry
> 1. pic TABLE ROWs
> |id_pic |pic |id_entry
> |1 |pic1.jpg |1
> |2 |pic2.jpg |1
> |3 |pic3.jpg |1
>
> 2. pic_desc TABLE ROWs (id_pic !PRIMARY)
> |id_pic |lang |desc
> |1 |hr |desc 1 HR
> |2 |hr |desc 2 HR
> |2 |en |desc 2 EN
>
> My query (parametar 'lang'):
> SELECT pic.id_pic, pic.pic, pic_desc.desc
> FROM pic
> LEFT JOIN pic_desc ON pic.id_pic = pic_desc.id_pic
> WHERE pic.id_entry =1
> AND (
> pic_desc.lang = 'en'
> OR pic_desc.lang IS NULL
> )
>
> QUERY RES lang='hr'
> |id_pic |pic |desc
> |1 |pic1.jpg |desc 2 HR
> |2 |pic2.jpg |desc 2 HR
> |3 |pic3.jpg |NULL
> OK
>
> QUERY RES lang='en':
> |id_pic |pic |desc
> |2 |pic2.jpg |desc 2 EN
> |3 |pic3.jpg |NULL
> !OK
> missing: pic1.jpg (id=1) desc=NULL
>
> If someone can explain what is happening or give me some solution
>
> Thanx
Navigation:
[Reply to this message]
|