Hello! We are online right now 15:06:03

The support team is online and will be able to answer your inquiries. Please stay calm, follow the rules and do not cross post. We'll attend to you as soon as we can.

Official support hours are from 8:30AM — 5:00PM Monday to Saturday (GMT +7)

question for API?

german
hi all. is it possible to obtain from the table the last review of the material, knowing the material ID in a mysql table?

5 replies

german
hi all. is it possible to obtain from the table the last review of the material, knowing the material ID in a mysql table?
JLexArt
May I don't understand your question. But if you know ID of an entry, you can use JLex Review module to retrieve latest reviews.
german
In other words. Can I get the last review through the API if you know the record ID? (Not using module) i.e. embed code in the template output K2 for example and get the latest review on the fly!
JLexArt
You can use this syntax to get latest review based on ID k2:
For MySQL: SELECT * FROM #__jlexreview WHERE `object`="k2" AND `object_id`={ID} ORDER BY created DESC  (!! Replace #_ by your database prefix).
--------
For Joomla embed code:
$db = JFactory::getDBO ();
$query  = $db->getQuery (true);
$query->select ("*")->from ("#__jlexreview")->where ("object='k2' AND object_id={ID}")->order ("created DESC");
$rows = $db->setQuery ($query,0,10)->loadObjectList ();

--->> $row is an Object has review property -->> Continue your code -->>
---------
p/s: I recommend you should use JLex Review module, because you can use some trick to add this module anywhere.
german
thanks for reply!
Reply to

Sign in to your account

Use your social accounts to sign in