Needing a little help trying to create a table: Here's the code: [code] if($genre != ''){ $genre_query = mysql_query($get_genre) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $get_genre . "<br />\nError: (" . mysql_errno() . ") " . mysql_error()); $file = 'empty.tx'; /*?>*/ echo "<table width=\"555\" height=\"336\" border=\"1\" style=\";\">\n"; echo "<tr>\n"; $mv_cnt = 0; while($r=mysql_fetch_array($genre_query)) { // $mv_cnt = 0; $mv_cnt = $mv_cnt+1; echo $mv_cnt."movie_count <br />"; echo "<td width=\"111\"><div align=\"center\"><a href=\"page_13003.php?q=".$r['id']."\"><img src=\"../videodb/cache/img/".md5($r['imgurl']).".jpg\" width=\"93\" height=\"140\" border=\"0\" /></a></div></td>\n"; if($mv_cnt == 5 or 10 or 15 or 20 or 25 or 30 or 35 or 40) { $nm_cnt = 0; echo "</tr>\n"; echo "<tr>\n"; //mysql_data_seek($genre_query, $mv_cnt+1); //reset(); while($r=mysql_fetch_assoc($genre_query)) { echo "<td><div align=\"center\"><a href=\"page_13003.php?q=".$r['id']."\">".$r['title']."</a></div></td>\n"; $nm_cnt = $nm_cnt+1; echo $nm_cnt."name_count <br />"; if ($nm_cnt >=5) { echo "</tr>\n"; echo "<tr>\n"; $nm_cnt = 0; mysql_data_seek($genre_query, $mv_cnt-1); break; } } } } echo "</tr>\n"; echo "<tr>\n"; echo "<td height=\"23\" colspan=\"2\">Search \n <input type=\"text\" name=\"textfield\" /></td> \n <td colspan=\"2\"><div align=\"center\"><a href=\"page_13003.php\">Back to Category Search </a></div></td> \n </tr> \n <tr> \n <td height=\"23\"><span class=\"style2\"><-- Previous page </span></td> \n <td height=\"23\" colspan=\"2\"><div align=\"center\" class=\"style2\">1 2 3 ..... 8 9 10 </div></td> \n <td height=\"23\"><div align=\"right\" class=\"style2\">Next Page ==></div></td> \n </tr> \n </table> \n "; } [/code] The code you see is very vague but it's where the root of my problems are. I'm trying to execute 2 while loops (one inside the other) so I can construct a table that has two rows, one of an image and one of a text link. |-------------| |Pretty Image | |@@@@@@@| |@@@@@@@| |@@@@@@@| |-------------| |Some Text | |-------------| The results I've come up with so far either cause the text rows to line up correctly and the images to space out as individual rows (what you see now); The images line up correctly and no text at all. Or the images and the text line up, but the text doesn't match the image. For instance, the image may be of some movie called dogs, cats, cows, chickens, horses. And the text underneath it would be crows, sheeps, goats and pigs. The text is what is in the data base, but in is what is left after the first loop stops. So if the data for the image is cats and dogs and then stops, then the text would pick up at cows chickens and horses. The table is supposed to be 5 columns of these tables, and I have yet make this work correctly. Any help or point to manuals would be great. Thanks, Yeshua