A
Anonymous
Guest
hai guys i need ur help regarding the deleting process. actually i wan the script as no record appear if the data is not in the database if the admin wants to delete the record wic is not in the database. but here the data is delete in the database but the message as "invalid........." is appearing.hw to solve this prob pls help me its urgent. above is the deleting coding:
Code:
<?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 "forum"
mysql_query("DELETE FROM forum Where
id='$id'")
or die(mysql_error());
$result = mysql_query("SELECT * FROM forum")
or die(mysql_error());
if (!$id==$id){
echo "<h1><font face='Algerian' size='5'>THE INFORMATION HAS BEEN DELETED SUCCESSFULLY.</font></h1>";
echo "<table border='1'>";
echo "<tr><th>id</th> <th>issue</th> <th>name</th> <th>email</th> <th>opinion</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['issue'];
echo "</td><td>";
echo $row['name'];
echo "</td><td>";
echo $row['email'];
echo "</td><td>";
echo $row['opinion'];
echo "</td></tr>";
}
echo "</table>";
}
else{
echo("<font face='Algerian' size='5' color='#99ccff'>Invalid record id.Please enter the correct id.</font>");
}
?>