English > General Questions
Retrieving translated category by SQL
Harald Leithner:
is this query from the debug view?
because jdiction didn't touched this query.
So its possible that it was unable to parse it.
could you try to execute the query by hand?
just copy this code to the index.php in the template folder
--- Code: ---$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select("id, owner_id, title, userfolder, latitude, longitude");
$query->from("#__phocagallery_categories AS myCategory");
$query->where("owner_id = 852");
$db->setQuery($query);
$x = $db->loadObjectList();
print_r($x);
--- End code ---
this should be translated.
if this doesn't work then there is a bigger problem with the jdiction installation.
after that please the ` to all fields like in your query and try again.
if this sill works, use this code:
--- Code: ---$db = JFactory::getDbo();
$query = "SELECT `id`, `owner_id`, `title`, `userfolder`, `latitude`, `longitude` FROM `cwosjm_phocagallery_categories` AS `myCategory` WHERE owner_id = 852";
$db->setQuery($query);
$x = $db->loadObjectList();
print_r($x);
--- End code ---
If this sill work then chronoforms does some unnice query string that couldn't be parsed by jdicion.
zigzo:
Thanks for your reply!
The 1st one works. And when I added ` for all fields, it works too.
The 1-line query code doesn't work though.
Harald Leithner:
to things I made an error at
"FROM `cwosjm_phocagallery_categories` AS `myCategory`"
this should be
"FROM `#__phocagallery_categories` AS `myCategory`"
also try this query without `
zigzo:
All of them work. So it must be some manipulation inside the chronoforms...
I have just tried your code for the sql query instead of the default chronoform action and it works now~
Thanks for your help!
Harald Leithner:
If you can life with it take the first version for performance reasons
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version