Brug HTML-tegnene:
<table>
<tr>
<td>Felt1</td>
<td>Felt2</td>
<td>Felt3</td>
<td>Felt4</td>
</tr>
<?php
// Hent data vha. mysql...
// start af while
echo "
<tr>
<td>$felt1</td>
<td>$felt2</td>
<td>$felt3</td>
<td>$felt4</td>
</tr>";
// slut while
?>
</table>
Kan du se idéen?
mikl | mikl@mikl.dk | MSN: mikl@mikl.dk
[Redigeret d. 19/05-03 17:05:10 af mikl-dk]
[Redigeret d. 19/05-03 17:05:22 af mikl-dk]
Jeg forstår skam, og det var næsten også det var en af mine forsøg, men fik det ikke til at virke.
Den kommer med en fejl i linie 44. Her er min kode:
Hvordan indsætter i kode, så man kan foldes det ud? - det ser jo s**** smart ud
<html>
<head>
<title>Tjaaaaaaaaa</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse; padding-left: 5; padding-right: 5" width="100%">;
<tr>;
<td width="11%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Varenummer</font></b></td>;
<td width="11%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Brand</font></b></td>;
<td width="11%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Model</font></b></td>;
<td width="11%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Colour</font></b></td>;
<td width="11%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Country</font></b></td>;
<td width="11%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Shipment</font></b></td>;
<td width="11%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Price</font></b></td>;
<td width="11%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Total</font></b></td>;
<td width="12%" bgcolor="#063973"><b>;
<font face="Verdana" size="2" color="#C0C0C0">Date</font></b></td>;
</tr>
<?
//Opretter forbindelse til MySQL
$db = mysql_connect("localhost","kgp43","xxxxxx");
//Vælger den database der skal bruges
mysql_select_db("clothing",$db);
//Henter data
$resultat = mysql_query("select no, brand, model, colour, country, shipment, price, total, date from jeans");
while ($raekke = mysql_fetch_array($resultat)) {
extract($raekke);
echo "
<tr>
<td width="11%" bgcolor="#E4E4E4">$no</td>
<td width="11%" bgcolor="#E4E4E4">$brand</td>
<td width="11%" bgcolor="#E4E4E4">$model</td>
<td width="11%" bgcolor="#E4E4E4">$colour</td>
<td width="11%" bgcolor="#E4E4E4">$country</td>
<td width="11%" bgcolor="#E4E4E4">$shipment</td>
<td width="11%" bgcolor="#E4E4E4">$price</td>
<td width="11%" bgcolor="#E4E4E4">$total</td>
<td width="12%" bgcolor="#E4E4E4">$date</td>
</tr>";
}
?>
</table>
</body>
</html>
[Redigeret d. 19/05-03 17:44:14 af Kenneth Poulsen][Redigeret d. 19/05-03 17:55:23 af Kenneth Poulsen]