Weis jemand was da falsch ist will einfach nur die Daten abrufen aus der db abrufen
erhalte immer fehler :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\Webserver\xampp\htdocs\myCDDatabase\db_view2.ph p on line 13
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in E:\Webserver\xampp\htdocs\myCDDatabase\db_view2.ph p on line 27
config2.php
erhalte immer fehler :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\Webserver\xampp\htdocs\myCDDatabase\db_view2.ph p on line 13
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in E:\Webserver\xampp\htdocs\myCDDatabase\db_view2.ph p on line 27
PHP-Code:
<html>
<body>
<table>
<?php
include ("db_config2.php");
$query = "SELECT * FROM $table";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result)) {
?>
<tr>
<td><?=$line[id]?></td>
<td><?=$line[CDDVD]?></td>
<td><?=$line[Bezeichnung]?></td>
<td><?=$line[Kategorie]?></td>
<td><?=$line[Ausgeliehen]?></td>
<td>[url="db_update.php?id=<?=$line[id]?>"]Editieren[/url]</td>
<td>[url="db_delete.php?id=<?=$line[id]?>"]Löschen[/url]</td>
</tr>
<?php
}
mysql_free_result($result);
mysql_close();
?>
</table>
[url="db_insert.php"]Eintrag erstellen[/url]
</body>
</html>
?>
PHP-Code:
<?php
$db ="DVD-Datenbank";
$host ="localhost";
$user ="root";
$pass ="sql";
$table ="dvd-datenbank";
mysql_connect($host,$user,$pass);
mysql_select_db($db);
?>
Kommentar