RE: One more question
| From: | Martin Towell | Date: | Tue, 30 Jul 2002 06:16:04 +0000 |
| Subject: | RE: One more question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-110296@lists.php.net to get a copy of this message | ||
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:icaam@icaam.com.ar]
Sent: Tuesday, July 30, 2002 3:27 PM
To: martin.towell@world.net; 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:webmaster@icaam.com.ar> Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621