Dear please help me
i am getting some error in my code
this is my view.php page
<html>
<body>
<table style="border:#333 solid" border="2">
<tr>
<td>ID:</td>
<td>NAME:</td>
<td>EMAIL:</td>
<td>MOBILE:</td>
<td>EDIT:</td>
<td>DELETE:</td>
</tr>
<?php
include_once('connect.php');
$query="select * from emp";
$conn=mysqli_query($con,$query);
if(isset($conn))
{
echo"This is all data of table.";
}
else
{
die("query is not execute". mysqli_error());
}
while($row=mysqli_fetch_array($conn))
{
?>
<tr>
<td><?php echo $row['emp_id']; ?></td>
<td><?php echo $row['emp_name']; ?></td>
<td><?php echo $row['emp_address'] ?></td>
<td><?php echo $row['emp_salary'] ?></td>
<td><a href="edit.php?id=<?php echo $row['emp_id'];?>"><font color="#FF0000">EDIT</font></a></td>
<td><a href="delete.php?id=<?php echo $row['emp_id'];?>"><font color="#FF0000">DELETE</font></a></td>
</tr>
<?PHP
}
?>
</table>
</body>
</html>
and this is my delete.php file:
<?php
include_once('connect.php');
$id=$_GET['emp_id'];
$query="delete from emp where emp_id='$id'";
$del=mysqli_query($con,$query);
if($del)
{
echo"record has been deleted";
}
else
{
die("Record is not deleted it is query error.".mysqli_error());
}
?>
How can I access the ID of the view.php in the delete.php file and how to delete a single row in my db table. I don't understand how to access the id of view.php. In this program I don't delete the selected row. Please tell me how to delele data. please anyone help me.