ich wollte eine ausgabe funktion in eine Datei schreiben.(funktionen.php)
das Problem ist bei manchen Tabellen in meiner datenbank funktioniert es und bei der Hardwaretype tabelle nicht.
Fehlermeldung:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\xampp\htdocs\bla\frames\funktionen.php on line 19
Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in C:\xampp\xampp\htdocs\bla\frames\funktionen.php on line 20
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\xampp\xampp\htdocs\bla\frames\funktionen.php on line 32
code: von der funktionen.php
<?
function ausgabe($result1)
{
$rows = mysql_num_rows($result1);
$cols = mysql_num_fields($result1);
echo "<table border = 1>";
echo "<tr>";
//Spaltenbeschriftung
for ($i=0; $i < $cols; $i++) {
echo "<th style=\"border:medium solid red\">", htmlentities(mysql_field_name($result1, $i)), "</th>";
}
echo "</tr>";
//Tabelleninhalt
while($row = mysql_fetch_row($result1)) {
echo "<style>";
echo "td { border:thin solid blue; }";
echo "</style>";
echo "<tr>";
for ($i=0; $i < $cols; $i++) {
echo "<td>", htmlentities($row[$i]), "</td>";
}
echo "</tr>";
}
echo "</table>";
}
?>