You'll have to check that the results you get back from the database
actually contains something before you echo anything out.
Another way would be something like this
$numcols = 2;
$counter = 0;
while (($results = mysql_results(...)) !== false) // haven't used mysql,
so you'll have to fix this line up :)
{
if ($counter % $numcols == 0) echo "<tr>";
// echo <td>image stuff here</td>
if ($counter % $numcols == $numcols-1) echo "</tr>";
}
if ($counter % $numcols != $numcols-1) echo "</tr>";
(if I remember your original post correctly....)
Martin
-----Original Message-----
From: C�sar Aracena [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 3:27 PM
To: [EMAIL PROTECTED]; PHP General List
Subject: One more question
Martin.
Hoping you are still there, I would like to ask you one more question about
the last mail you answered me about Table Formatting (maybe you missed my
last question ;). After I used what you told me for nesting FOR loops, I end
up getting one blank image (NOT DISPLAYED) whenever I have an odd quantity
of objects in my DB... Do I have to store objects in the DB by 2 from now
on?
I'm working it for http://www.saavedraart.com <http://www.saavedraart.com/>
under the gallery section (only module I have so far). It would be nice if
you check it out and tell me your opinion. Same goes for everybody else ;)
Thanks a lot,
<mailto:[EMAIL PROTECTED]> Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621