I have created one link on different page (Delete). After that, I wrote following code to execute the query, but somehow it's showing the 'success' message, but it's not deleting particular record from database... Any suggestions?
<?php
include_once('data_conn.php');
$id=$_GET['id'];
$sql = "DELETE FROM driver_info where id=$id";
echo $sql;
if(!$sql ) {
echo '<script language="javascript">';
echo 'alert("something went Wrong...:(((("); location.href="user-profile.php"';
echo '</script>';
}
else{
echstrong texto '<script language="javascript">';
echo 'alert("successfully Deleted!!!"); location.href="user-profile.php"';
echo '</script>';
mysql_close();
}
?>