let’s say that i have this simplyfied code:
$sql = dbquery("SELECT * FROM videos WHERE views > 4 ORDER BY id DESC LIMIT 0,10 ");
while($row = mysql_fetch_array($sql)){
$url = $row["url"];
$title = $row["title"];
$list ='<div><a href="'.$url.'" >'.$title.'</a></div>';
$ad ='<div>something here</div>';
}
echo $list;
instead to display a list of 10 divs, i want to echo 5 divs from $list, echo $ad then echo the rest of the $list
How can i do this?
Later edit :
First problem solved thanks to Michael.
Now, i have a problem with my template, and i don’t know how can i add to every X number of $list divs, class=”nomar”?
You can use a counter
$i