delete more ten 1 item

A

Anonymous

Guest
guys can u help me by editin tis coddin.

<?php
$id = $_POST['id'];


mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("eraccdb") or die(mysql_error());

// Insert a row of information into the table "complaint"
mysql_query("DELETE FROM complaint Where
id='$id'")
or die(mysql_error());
?>
<?
$result = mysql_query("SELECT * FROM complaint")
or die(mysql_error());

echo "<table border='1'>";
echo "<tr><th>id</th> <th>name</th> <th>age</th> <th>race</th> <th>nric</th> <th>address</th> <th>address2</th> <th>city</th> <th>postcode</th> <th>state</th> <th>home</th> <th>email</th> <th>mobile</th> <th>office</th> <th>date</th> <th>type</th> <th>enquiry</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['name'];
echo "</td><td>";
echo $row['age'];
echo "</td><td>";
echo $row['race'];
echo "</td><td>";
echo $row['nric'];
echo "</td><td>";
echo $row['address'];
echo "</td><td>";
echo $row['address2'];
echo "</td><td>";
echo $row['city'];
echo "</td><td>";
echo $row['postcode'];
echo "</td><td>";
echo $row['state'];
echo "</td><td>";
echo $row['home'];
echo "</td><td>";
echo $row['email'];
echo "</td><td>";
echo $row['mobile'];
echo "</td><td>";
echo $row['office'];
echo "</td><td>";
echo $row['date'];
echo "</td><td>";
echo $row['type'];
echo "</td><td>";
echo $row['enquiry'];
echo "</td>";
}
echo "</table>";

?>

this is coddin for delete function of 1 item.how to do delete more then 1 item at the same time
 
Back
Top