i got that but why is it not executing my sql query? no matter what ever numeric value i input i get it printed by using print_r(); func but when i use $id = $_POST['id']; nothing prints
<?php
include 'db.php';
print_r($_POST['id']);
if(isset($_POST['submit'])){
$id = $_POST['id']; // The $id is not effecting the sql query WHERE id='".$id."'
$sql="SELECT `id`, `image` FROM `tbl` WHERE id='".$id."'";
$result = mysql_query($sql);
if(!$result){
}else{
while($row = mysql_fetch_array($result)){
if (mysql_num_rows($result)) {
$id = $row['id'];
if(!unlink($row['image'])){
}
}
$sql="DELETE FROM tbl WHERE id = '".$id."'";
$result= mysql_query($sql);
if(!$result){
}
}
}
}
?>
<form action="delete.php" method="POST">
<input type="text" name="id">
<input type="submit" value="Delete">
</form>