PHP-Code:
	
	
$db=@mysql_pconnect($host, $user, $password);
$select=@mysql_select_db($dbname, $db);
if($submit) {
$y=count($loeschen);
echo "$y Datensätze werden gelöscht.<br><br>";
    for($x=0;$x<$y;$x++) {
    mysql_query("delete from test where ID='$loeschen[$x]'");
    echo "Gelöscht: $loeschen[$x] <br>";
    }
}
$result = mysql_query ("select * from test ORDER BY index");
if(mysql_num_rows($result)) {
?>
<form method="post" action="test.php">
  <table width="500" border="0" cellspacing="0" 
cellpadding="0">
<?  
    
    while ($row=mysql_fetch_array($result,MYSQL_ASSOC)) {
    $ID=$row["id"];
  $feld=$row["text"];
    $index=$row["index"];
?>
    <tr>
      <td width="50" align="left"><b><? echo $ID ?></b></td>
<td width="300" align="center"><? echo $feld ?></td>
            <td width="30">
        <input type="checkbox" name="loeschen[]" value="<? echo $index ?>" >
      </td><? } ?><td align="right" valign="center" width="150">
<input type="submit" name="submit" value="Löschen"></td>
  </tr>
  </table>
</form>
<?
} else {
echo "Keine Daten gefunden.";
}
?>
Mein Fehler liegt bei
PHP-Code:
	
	
mysql_num_rows($result) 
mit BIGINT definiert, sondern über INT.
Ausgabe des Browsers: mysql_num_rows():
supplied argument is not a valid MySQL result resource
in /home/.sites/12/site172/web/inc/test.php on line 50
Keine Daten gefunden.
Bitte um Hilfe
MFG jakob
Ausgabe durch error_reporting(E_ALL);:
Notice: Undefined variable: submit in /home/.sites/12/site172/web/inc/test.php on line 38
Warning: mysql_num_rows(): supplied argument
is not a valid MySQL result resource in /home/.sites/12/site172/web/inc/test.php
on line 51 Keine Daten gefunden.
 
          
 
							
						
Kommentar