1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <?php
// no direct access
defined('_JEXEC') or die;
require_once JPATH_SITE . '/components/com_tlptestimonial/helpers/tlptestimonial.php';
//Add database instance
$db= JFactory::getDBO();
//Pass query Limit by count parameter (Check XML)
if($category>0){
$query="SELECT * FROM #__tlptestimonial_testimonial WHERE category=$category AND state=1 ORDER BY $ordering LIMIT 0,$testimonialcount";
}else{
$query="SELECT * FROM #__tlptestimonial_testimonial WHERE state=1 ORDER BY $ordering LIMIT 0,$testimonialcount";
}
//Run The query
$db->setQuery($query);
//Load it as an Object into the variable "$rows
$rows = $db->loadObjectList(); |