in tabelvorm weergeven
ik ben al een tijdje bezig om een script te selecten via mysql, en dat het dan in een tabelvorm komt, maar het wil me maar nie lukken, om ze samen te voegen, de tabel heb ik al gemaakt, dat zie je bij
http://www.owndatabase.com/sel_property.html
script daar van is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel = "stylesheet" type = "text/css" href = "scheme.css">
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<p span class=header>Koninginnelaan 1</p>
</td>
</tr>
<tr>
<td height="1" bgcolor="#9D0000" valign="top">
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<td width="150" valign="top">
<img src="ddd.jpg">
</td>
<td width="8">
</td>
<td valign="top">
<br>
Zipcode: 2313 AP<br>
City: leiden<br>
Status: parked house<br>
Area: Amsterdam Jordaan<br>
Available from 23-12-2004 untill 24-12-2005<br>
Parking: Permit waiting list<br>
Kitchen: open<br>
Toilet: in bathroom<br>
Funised: unfurnised<br>
Notes: jaaaaaaa<br>
</td>
</table>
</td>
</table>
</table>
</body>
</html>
de phpscript is
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?
include("config.php");
$sql = "SELECT * FROM property";
$res = mysql_query($sql)
or die ("Cannot execute query");
while($var = mysql_fetch_object($res)) {
echo "<tr><td>".$var->street."</td>\n";
echo "<td>".$var->no."</td>\n";
echo "<td>".$var->zip."</td>\n";
echo "<td>".$var->city."</td>\n";
echo "<td>".$var->status."</td>\n";
echo "<td>".$var->type."</td>\n";
echo "<td>".$var->area."</td>\n";
echo "<td>".$var->available."</td>\n";
echo "<td>".$var->tos."</td>\n";
echo "<td>".$var->parking."</td>\n";
echo "<td>".$var->kitchen."</td>\n";
echo "<td>".$var->toilet."</td>\n";
echo "<td>".$var->furnised."</td>\n";
echo "<td>".$var->notes."</td>\n";
}
?>
include("config.php");
$sql = "SELECT * FROM property";
$res = mysql_query($sql)
or die ("Cannot execute query");
while($var = mysql_fetch_object($res)) {
echo "<tr><td>".$var->street."</td>\n";
echo "<td>".$var->no."</td>\n";
echo "<td>".$var->zip."</td>\n";
echo "<td>".$var->city."</td>\n";
echo "<td>".$var->status."</td>\n";
echo "<td>".$var->type."</td>\n";
echo "<td>".$var->area."</td>\n";
echo "<td>".$var->available."</td>\n";
echo "<td>".$var->tos."</td>\n";
echo "<td>".$var->parking."</td>\n";
echo "<td>".$var->kitchen."</td>\n";
echo "<td>".$var->toilet."</td>\n";
echo "<td>".$var->furnised."</td>\n";
echo "<td>".$var->notes."</td>\n";
}
?>
</table>
</body>
</html>
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?
while($var = mysql_fetch_array($res)) {
ipv
while($var = mysql_fetch_object($res)) {
?>
while($var = mysql_fetch_array($res)) {
ipv
while($var = mysql_fetch_object($res)) {
?>
robin:
maar doe je hier niet 2x een tabel?