Here is the code I have used to get the result below:
[code]$query = “SELECT * FROM news”;
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
$count = 0;
?>
<?php
while ($row = mysql_fetch_assoc($result)){
If($count <3)
{
?>
<?php echo $row['profile']; ?> |
<?php
$count++;
}else{
?>
<?php echo $row['profile']; ?> |
<?php
$count = 0;
}
// End of while statement
}
?>
[/code]
Here is the result I get:
Midnight Racer Midnight Racer Midnight Racer
Midnight Racer
Here is the result I want to get to:
Midnight Racer Midnight Racer Midnight Racer
Profile 1 Profile 2 Profile 3
Midnight Racer
Profile 4
As you can see above the loop works to display one piece of information then start a new row but I want to display the first row of information then start a new row to display the profile information. Then when 3 results have been displayed start a new row and display the 4th result onwards with the profile underneath as shown above.
Hopefully this explains what i am trying to do I hope somebody will be able to let me know how I can do this as I have tried a veriety of things but it never looks how I want it.