gegevens in tabel
phpdude
24/09/2004 14:00:00ik wil een tabelletje maken op een site, waar dan de gegevens met kolommen lname, fname, nationality, enz wil neer zetten waar zit ik dat dan in, in de script
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?
include("config.php");
$sql = "SELECT * FROM clients";
$res = mysql_query($sql)
or die ("Cannot execute query");
while($var = mysql_fetch_object($res)) {
echo "<tr><td>".$var->lname."</td>\n";
echo "<td>".$var->fname."</td>\n";
echo "<td>".$var->nationality."</td>\n";
echo "<td>".$var->street."</td>\n";
echo "<td>".$var->no."</td>\n";
echo "<td>".$var->city."</td>\n";
echo "<td>".$var->zip."</td>\n";
echo "<td>".$var->country."</td>\n";
echo "<td>".$var->fax."</td>\n";
echo "<td>".$var->email."</td>\n";
echo "<td>".$var->alt_email."</td>\n";
echo "<td>".$var->mobile."</td>\n";
echo "<td>".$var->phone."</td>\n";
echo "<td>".$var->work."</td></tr>";
}
?>
include("config.php");
$sql = "SELECT * FROM clients";
$res = mysql_query($sql)
or die ("Cannot execute query");
while($var = mysql_fetch_object($res)) {
echo "<tr><td>".$var->lname."</td>\n";
echo "<td>".$var->fname."</td>\n";
echo "<td>".$var->nationality."</td>\n";
echo "<td>".$var->street."</td>\n";
echo "<td>".$var->no."</td>\n";
echo "<td>".$var->city."</td>\n";
echo "<td>".$var->zip."</td>\n";
echo "<td>".$var->country."</td>\n";
echo "<td>".$var->fax."</td>\n";
echo "<td>".$var->email."</td>\n";
echo "<td>".$var->alt_email."</td>\n";
echo "<td>".$var->mobile."</td>\n";
echo "<td>".$var->phone."</td>\n";
echo "<td>".$var->work."</td></tr>";
}
?>
Er zijn nog geen reacties op dit bericht.