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
8 years ago
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.
8 years ago
hi all. is it possible to obtain from the table the last review of the material, knowing the material ID in a mysql table?
8 years ago
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!
8 years ago
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.
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.
8 years ago
thanks for reply!
Reply to
Latest articles
-
Outstanding Features of Joomla: Why It's a Top Choice Among Open-Source CMS Platforms
- Joomla
- WordPress
-
Youtube Module Documentation
- Youtube
- Documentation
-
JLex Transfer Documentation
- Documentation
- JLex Transfer
-
YouTube Video Categories List
- Youtube
-
JLex Comment Documentation
- JLex Comment
- Documentation
-
Tips to have an effective design for your Joomla E-commerce Website
- Joomla
- Web design
-
Why ratings and reviews are important for your website
- Joomla
- JLex Review