Jump to content

Sorta complicated while loop


iandotcom

Recommended Posts

I'm looping the results of a MySQL query which displays the 9 most recent records in the table.

 

When I'm printing it though, I need to change the output though for every third iteration in the loop, to change the HTML that is outputted when it is printed. Its to keep the design looking correctly.

 

How would I go about this?

 

Heres the code if your a bit stumped on what I mean:

 

<?php
$RecentQuery = mysql_query("SELECT * FROM `blog` LIMIT 0 , 9");
while($Recent = mysql_fetch_array($RecentQuery, MYSQL_ASSOC)){
?>

// Outputted HTML code goes here

<?php } ?>

 

Cheers

 

-- Ian.

Link to comment
https://forums.phpfreaks.com/topic/120236-sorta-complicated-while-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.