Try replacing this. else { while( $assoc = mysql_fetch_assoc( $result ) ) { print_r( $assoc ); } } PHP: With this. (Untested) else { $int = 0; echo '<table border="1" cellpadding="2">' . "\n"; echo "<tr>\n"; while( $assoc = mysql_fetch_assoc( $result ) ) { echo '<td><img src="data/'. $assoc['id'] .'.jpeg" /></td>'. "\n"; } if (++$int % 6 == 0) { echo "</tr><tr>\n"; } echo "</tr>\n"; echo "</table>"; } PHP:
My bad, this: if (++$int % 6 == 0) { echo "</tr><tr>\n"; } PHP: Should have gone in the loop. Try placing it under the echo in the while loop.
yey that worked! once again, thank you, thank you so very much for the help ^_^ i ove both you and joe!