First of all, thank you for taking your time to answer my question. I played with this and maybe didn't approach it the best way. I am still have problems with this.
Here is my revised code:
for ($i=1; $i<=6; ++$i) {
while ($row = mysql_fetch_array($result)){
if ( $i == 1 || $i == 4){
$body .= "<tr>";
}
$body .= "<td><img src='".$row['imagePath']."'>";
$body .= "<br>test ".$i."</td>";
if ($i == 3 || $i == 6){
$body .= "</tr>";
}
}
}
echo $body;
I think the problem comes in is where when it hits the while loop it loops all of the results and than goes back to the for loop. The reason I say this is that I put the verbage:
test."$i"
and this echos out one and dumps each result on the a new row as if.
Is there a way I could combine to loops in one where it will loop for each specific result.
Or is there a better way to approach this.
Thanks again for your time.