English > General Questions
Retrieving translated category by SQL
zigzo:
Hello,
I am using jDiction and Phoca Gallery and with the jdiction.xml in another thread I could translate the category names successfully. Thanks!
However, I got a problem when trying to write some codes to select categories from the category table. When I use select title from the category table, it can only retrieve the original names.
How can I get the translated titles according to my site language? Do I need to refer to the jdiction sql table in my code as well? Thanks!
Harald Leithner:
No this is not needed, jdiction intercept your query and adds the table key to the select list. After this it translates it on the fly.
You should use jdatabasequery so this could work without problems.
show me your sql query + php code
zigzo:
Hi, thanks for your reply.
Actually I'm using chronoforms to generate the DB query to select the id, title...etc. from _phocagallery_categories. The title is translated using jdiction.
I have attached the related php code.
Thanks for helping!!
Harald Leithner:
Hmm is a bit hard to say... maybe its better you show me the db query. Use the joomla debugmode to show all queries.
zigzo:
The query is like this:
SELECT `id`, `owner_id`, `title`, `userfolder`, `latitude`, `longitude`
FROM `cwosjm_phocagallery_categories` AS `myCategory`
WHERE owner_id = 852
And then I refer to the 'title' field to display in dropdown box.
Navigation
[0] Message Index
[#] Next page
Go to full version