timon
24-04-2003, 15:10
...aber ich sehe vor lauter besipielen und internetseiten "nichts" mehr, und mein skript geht trotzdem nicht.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Timon-Links</title>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffcc66" link="#000099" vlink="#000099"
alink="#000099">
<br>
<?php
$host = "localhost";
$dbname = "book";
$user_id = "xxxx";
$user_pass = "xxxx";
//connect to database
mysql_pconnect($host, $user_id, $user_pass) or die ('no connection');
mysql_select_db($dbname) or die ('no db');
$query = "SELECT kat FROM books order by kat asc";
$result = mysql_query($query);
?>
<table width="700" border="2" cellspacing="0" cellpadding="0">
<?
while ($r = mysql_fetch_array($result)) {
?>
echo "<tr><td>$r['kat']</td></tr>"
<?
}
mysql_close();
?>
</table>
</body>
</html>
mein problem ist die ausgabe der variable $r['kat'] in die tabelle . er schreibt mir zwar $r['kat' in die tabelle, allerdings als text und nicht den inhalt der variablen.
ich habe inzwischen viel rumversucht und ausprobiert, cih sehe den fehler nicht. meine php version ist 4.2.2. wäre toll wenn ihr mit nen tipp geben könntet.
timon
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Timon-Links</title>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffcc66" link="#000099" vlink="#000099"
alink="#000099">
<br>
<?php
$host = "localhost";
$dbname = "book";
$user_id = "xxxx";
$user_pass = "xxxx";
//connect to database
mysql_pconnect($host, $user_id, $user_pass) or die ('no connection');
mysql_select_db($dbname) or die ('no db');
$query = "SELECT kat FROM books order by kat asc";
$result = mysql_query($query);
?>
<table width="700" border="2" cellspacing="0" cellpadding="0">
<?
while ($r = mysql_fetch_array($result)) {
?>
echo "<tr><td>$r['kat']</td></tr>"
<?
}
mysql_close();
?>
</table>
</body>
</html>
mein problem ist die ausgabe der variable $r['kat'] in die tabelle . er schreibt mir zwar $r['kat' in die tabelle, allerdings als text und nicht den inhalt der variablen.
ich habe inzwischen viel rumversucht und ausprobiert, cih sehe den fehler nicht. meine php version ist 4.2.2. wäre toll wenn ihr mit nen tipp geben könntet.
timon