In php file while loop is used to populate data in array in a following
way,
$result = mysql_query($sql ) or die ('Error, list failed. ' . mysql_error());
while($row = mysql_fetch_array($result))
{
$row[tableLegends];
$link[]=$row;
}
and for loop is used in printing data in theme file
for ($j=0; $j<count($link); $j++)
{
echo $link[$j]['f_name'];
echo $link[$j]['l_name'];
------code here-------
}
Actually, I want to use foreach loop in place of for loop.
Any idea please..