Select field sql query multilanguage - FC 2.2.0 stable

More
10 years 1 month ago - 10 years 1 month ago #54553 by tevez15
Hello,

I need some help, I'm using a select field with sql query, but my website is multilang, and when I change the language of my site, I need get the article in EN for example:

Normal version:
Code:
"SELECT id, title AS value,title from #__flexicontent_items_tmp where catid=25 GROUP BY title

So, in falang I try someting like:
Code:
SELECT id, title AS value,title from #__flexicontent_items_tmp where catid=25 and [b][i]language='en-GB'[/i][/b] GROUP BY title

In php my admin, that works, but in my select dont, and return me only 2 items, in pt..

EDIT: I try something like:
Code:
SELECT i.id, i.title, i.catid, i.state, i.language AS value,title FROM #__content AS i LEFT JOIN #__flexicontent_items_ext AS ie on i.id=ie.item_id JOIN #__flexicontent_cats_item_relations AS rel on i.id=rel.itemid WHERE rel.catid IN (25) AND (ie.language='en-GB' OR ie.language='*') AND i.state IN (1, -5) GROUP BY rel.itemid ORDER BY i.title ASC

And dont work.. on select field, on phpmyadmin, work perfectly!


FINAL: What's wrong? Simple, you need associate the EN items (CATID 25) to the other articles on CAT 26 to show on filter, so:
Code:
SELECT id, title AS value,title FROM #__content where catid=25

WORK!

Any idea?
Attachments:
Last edit: 10 years 1 month ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #54558 by tevez15
The following user(s) said Thank You: micker

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.648 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save