I want to show up to 3 images that are assigned to the logged in user in a database table. I have written the following MySQL query:
$db = JFactory::getDBO();
//GET GALLEERY IMAGES
$query = $db->getQuery(true);
$query->select('*');
$query->from('#__mcloud_mgallery');
$query->where('model_id = '.$userid);
$query->order('id');
$db->setQuery($query);
$rows = $db->loadObject();
$gallery_img = $rows->file;
If I echo $gallery_img
this outputs only one of the images, if I look in the database table (for the logged in user) there are 3 images assigned to that user:
id file model_id
389 10_burgers_food.jpeg 941
390 14_bridge.jpeg 941
391 test_imag.jpeg 941
How can I show the 3 images if there's only 1 variable $gallery_img
?