I got this code in my administration.php:
<?php
include("conn.php");
session_start();
if(!isset($_SESSION['user'])){
header("location:index.php");
exit();
}
if(isset($_REQUEST['user'])){
mysql_query("DELETE FROM tblru WHERE user=" . $_REQUEST['user']);
if(mysql_affected_rows($con)>0){
header("location:administration.php");
exit();
}
else{
echo "ERROR in deleting the user!";
}
}
?>
I got this code on the body:
<?php
$result=mysql_query("SELECT * FROM tblru");
if(mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result)){
echo "<tr bgcolor='#999999'>
<td>" . $row[0] . "</td>
<td>" . $row[1] . "</td>
<td align='center'><a href='administration.php?user=" . $row[0]."' onClick=\"return confirm('Confirm Deletion of Registered User?');\"><font color='#FFFFFF'>Delete</font></a></td></tr>";
}
}
?>
i keep getting error in deleteing records, can anyone check this out why it always displays like that