How to SET LIMIT in Joomla Database with PHP? If logged in users who belongs to group 2 I should see only 3 values and if logged in user who belongs to group 6 I should see only 9 values out of n number of data.
<?php
$dbo = JFactory::getDBO();
$user=& JFactory::getuser();
$admin = $user->get('username');
$groups = $user->get('groups');
foreach($groups as $id) {
echo "<p>Group ID is:" . $id . "</p>";
// how to assign the limit ?
if($id ==2){
echo "<ul id='jchat_conference_userslist'></ul>"; // 3 users
} elseif($id ==6){
echo "<ul id='jchat_conference_userslist'></ul>"; // 9 users
}
}?>