Jules-Verne
Lt. Junior Grade
- Registriert
- Aug. 2001
- Beiträge
- 289
hab vor mit einem PHP Code alle Datensätze anzuzeigen aber die Tabelle zeigt nur die Überschrift und die Zeilen aber keine Inhalte:
Noch ein Bild wie es in PHPmyadmin aussieht:
https://www.computerbase.de/forum/attachments/untitled-1-jpg.66614/
<html>
<body>
<?php
mysql_connect("","root");
mysql_select_db("telefonbuch");
$res = mysql_query("select * from namen");
$num = mysql_num_rows($res);
// Tabellenbeginn
echo "<table border>";
// Überschrift
echo "<tr> <td>Lfd. Nr.</td> <td>Name</td>";
echo "<td>Handy</td> <td>Festnetz</td> </tr>";
$lf = 1;
while ($dsatz = mysql_fetch_assoc($res))
{
echo "<tr>";
echo "<td>$lf</td>";
echo "<td>" . $dsatz["name"] . "</td>";
echo "<td>" . $dsatz["handy"] . "</td>";
echo "<td>" . $dsatz["festnetz"] . "</td>";
echo "</tr>";
$lf = $lf + 1;
}
// Tabellenende
echo "</table>";
?>
</body>
</html>
Noch ein Bild wie es in PHPmyadmin aussieht:
https://www.computerbase.de/forum/attachments/untitled-1-jpg.66614/
<html>
<body>
<?php
mysql_connect("","root");
mysql_select_db("telefonbuch");
$res = mysql_query("select * from namen");
$num = mysql_num_rows($res);
// Tabellenbeginn
echo "<table border>";
// Überschrift
echo "<tr> <td>Lfd. Nr.</td> <td>Name</td>";
echo "<td>Handy</td> <td>Festnetz</td> </tr>";
$lf = 1;
while ($dsatz = mysql_fetch_assoc($res))
{
echo "<tr>";
echo "<td>$lf</td>";
echo "<td>" . $dsatz["name"] . "</td>";
echo "<td>" . $dsatz["handy"] . "</td>";
echo "<td>" . $dsatz["festnetz"] . "</td>";
echo "</tr>";
$lf = $lf + 1;
}
// Tabellenende
echo "</table>";
?>
</body>
</html>