Mailinglisten-Archive |
Hallo,
at Thursday 28.06.2001 (20:21 +0200), Roland Schmid wrote:
>Nun m=F6chte ich alle 2 Datens=E4tze eine neue Reihe anfangen.
[...]
>Wie definiere ich jetzt, da=DF er jeden 2. Datensatz eine neue Reihe
>anfangen soll? Hat jemand eine Idee? Danke vorab.
>Ich hoffe ich habe mich verst=E4ndlich ausgedr=FCckt :-)
Hast Du ! ;-)) Ich stand vor dem selben Problem, das ich ca. nach gut 2=20
Stunden gel=F6st habe.
Hier mal ein L=F6sungsansatz:
-----------
$content .=3D"
<table border=3D\"0\" cellpadding=3D\"0\" cellspacing=3D\"2\"=
width=3D\"100%\">
<tr>\n";
$x=3D0;
while ($myrow =3D _(at)_mysql_fetch_array($result)) {
$atext=3D$myrow["catname"];
=
$atext=3Dhtmlentities("$atext");
=
$dummy=3D$myrow["catselector"];
$content .=3D" <td=20
width=3D\"49%\" align=3D\"center\"><a=
href=3D\"/pages/bookshop.php4?cat=3D$dummy\"=20
title=3D\"$atext\"><b>$atext</b></a></td>\n";
if ($x<1) {
$content=20
.=3D" <td width=3D\"2%\"><img src=3D\"/images/blank.gif\" width=3D\"5\"=20
height=3D\"1\" alt=3D\"\"></td>\n";
}
$x++;
if ($x=3D=3D2) { $content=
.=3D"=20
</tr>\n <tr>\n"; $x=3D0; }
}
$content .=3D" <td colspan=3D\"3\"><img src=3D\"/images/blank.gif\"=
width=3D\"5\"=20
height=3D\"1\" alt=3D\"\"></td>\n </tr>\n";
$content .=3D"</table>\n";
-----------
Die Variabel $x steuert die Spaltenanzahl.
Ich hoffe einwenig geholfen zu haben.
Gru=DF
Michael
--=20
Phone +49 5723 98077 - 0
Fax +49 5723 98077 - 1
Mobil +49 173 4315914
Home http://www.macbyte-computing.de/
PGP-Key http://www.macbyte-computing.de/shared/mykey.pkr
php::bar PHP Wiki - Listenarchive