My problem is this: I'm listing stuff from my database with mysql_fetch_array
. I want to print custom row after 2nd loop iteration and before 3rd. So basically 3rd printed row is not coming from database. I have tried to create a running number for each iteration and then using if-function but this replaces 3rd row and it does not appear as 4th.
My code:
<?
$iteration = '0';
while($row = mysql_fetch_array($my_data))
{
$iteration = $iteration + 1;
if ($iteration =='3')
{
echo "My special row";
}
else
{
echo $row['name'];
}
}
?>