28. oktober 2003 - 21:55
Der er
14 kommentarer og 1 løsning
Hjælp til to koloner
Hey. er der en der kan hjælpe med at gøre så billederne kommer frem i to kolonner i stedet for en ? koden ser sådan her ud: ---------------------------------------------------- <? $sql = 'SELECT sti FROM `fest_pics` WHERE fest_id='.$_GET['id'].' LIMIT 0,10'; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $sti = $row["sti"]; echo "<a href=\"java script:popup('$sti')\"><img src=\"$sti\" border=\"0\" height=\"75\" width=\"100\"></a><br> <hr color=\"#cccccc\">"; } ?>
Annonceindlæg tema
Cloud & AI
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
28. oktober 2003 - 22:01
#1
<? $cells = 2; $cellcount = 1; $sql = 'SELECT sti FROM `fest_pics` WHERE fest_id='.$_GET['id'].' LIMIT 0,10'; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $sti = $row["sti"]; echo "<td><a href=\"java script:popup('$sti')\"><img src=\"$sti\" border=\"0\" height=\"75\" width=\"100\"></a><br> <hr color=\"#cccccc\"></td>"; if ($cellcount == $cells) { $cellcount = 0; echo "</tr><tr>"; } $cellcount++; } while ($cellcount <= $cells) { echo '<td></td>'; $cellcount++; } echo "</tr></table>"; ?>
28. oktober 2003 - 22:01
#2
<table><tr> <?php $cells = 2; // Antal celler ved siden af hinanden $cellcount = 1; $result = mysql_query('SELECT sti FROM `fest_pics` WHERE fest_id='.$_GET['id'].' LIMIT 0,10') or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $sti = $row['sti']; echo "<td><a href=\"java script: popup('$sti')\"><img src=\"$sti\" border=\"0\" height=\"75\" width=\"100\"></a></td>"; if ($cellcount == $cells) { $cellcount = 0; echo "</tr><tr>"; } $cellcount++; } // Udfylder de tommme celler while ($cellcount <= $cells) { echo "<td width=\"$tdwidth\"> </td>"; $cellcount++; } ?> </tr></table>
28. oktober 2003 - 22:02
#3
;o)
28. oktober 2003 - 22:03
#4
Eller prøv denne: <?php $cells = 2; $cellcount = 1; $result = mysql_query("SELECT sti FROM fest_pics WHERE fest_id='$_GET[id]' LIMIT 0,10") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<td><a href=\"java script:popup('$row[sti]')\"><img src=\"$row[sti]\" border=\"0\" height=\"75\" width=\"100\"></a><br> <hr color=\"#cccccc\"></td>"; if ($cellcount == $cells) { $cellcount = 0; echo "</tr><tr>"; } $cellcount++; } while ($cellcount <= $cells) { echo "<td></td>"; $cellcount++; } echo "</tr></table>"; ?>
28. oktober 2003 - 22:04
#5
Sådan... <?php echo "<table align="left" border="0"><tr>"; $cells = 2; $cellcount = 1; $result = mysql_query("SELECT sti FROM fest_pics WHERE fest_id='$_GET[id]' LIMIT 0,10") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<td><a href=\"java script:popup('$row[sti]')\"><img src=\"$row[sti]\" border=\"0\" height=\"75\" width=\"100\"></a><br> <hr color=\"#cccccc\"></td>"; if ($cellcount == $cells) { $cellcount = 0; echo "</tr><tr>"; } $cellcount++; } while ($cellcount <= $cells) { echo "<td></td>"; $cellcount++; } echo "</tr></table>"; ?>
28. oktober 2003 - 22:05
#6
puha i er jo ikke mere end 26 sek i mellem *G* i burde jo dele vil jeg mene, så Schaefner smid et svar
28. oktober 2003 - 22:05
#7
<table><tr> <?php $cells = 2; // Antal celler ved siden af hinanden $cellcount = 1; $result = mysql_query('SELECT sti FROM `fest_pics` WHERE fest_id='.$_GET['id'].' LIMIT 0,10') or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $sti = $row['sti']; echo "<td><a href=\"java script: popup('$sti')\"><img src=\"$sti\" border=\"0\" height=\"75\" width=\"100\"></a></td>"; if ($cellcount == $cells) { $cellcount = 0; echo '</tr><tr>'; } $cellcount++; } // Udfylder de tommme celler while ($cellcount <= $cells) { echo '<td></td>'; $cellcount++; } ?> </tr></table>
28. oktober 2003 - 22:06
#8
Dur den?
28. oktober 2003 - 22:11
#10
jeres første forslag virker fint..
28. oktober 2003 - 22:12
#11
ok...
28. oktober 2003 - 22:13
#12
Mit første forslag manglet der bare dette i toppen: echo "<table align="left" border="0"><tr>";
28. oktober 2003 - 22:16
#13
Zorg_86 den på siden fik den bare ikke taget med i spørgsmålet ;o)
28. oktober 2003 - 22:23
#14
Men jeg takker jer begge to... ;o)
28. oktober 2003 - 22:32
#15
takker..
Vi tilbyder markedets bedste kurser inden for webudvikling