I am using PDO to get result from database and then using foreach loop to display data.
my code is
$result1=$objPage->getGallery($id);
foreach($result1 as $row)
{
echo "pic1=" . $row['pic'];
echo "pic2=" . $row['pic'];
echo "pic3=" . $row['pic'];
echo "<br>";
}
Actually, I want to display three pictures names in one line and then next 3 names.
But now its printing one name 3 times.
You can use an external flag, like this: