I currently have a loop of items being shown on a page.
I would like to run the loop twice (output 2 results/items), and THEN insert a banner ONCE right after the 2nd result, and THEN let loop continue from where it left off.
An illustration below:
{--- START OF LOOP ---}
ITEM 1 | ITEM 2
{ BANNER HERE }
ITEM 3 | ITEM 4
ITEM 5 | ITEM 6
ITEM 7 | ITEM 8
{--- END OF LOOP ---}
<- prev | next ->
The items are inside a while loop:
$sql = mysql_query("SELECT id, img, description, keyword, category FROM images WHERE connect = 1 ORDER BY id DESC LIMIT $from , $perPage");
while($result = mysql_fetch_object($sql)) {
LOOP OF ITEMS HERE }
I've only ever found "do" / "while" methods, which isn't really what I'm looking for. If anyone could help, thank you for your time & assistance.