In my admin dashboard I created a page that show information from 2 tables using a foreign key Id_clt, now I created the delete query but it didn't work Please correct me if I did something wrong, Thanks.
$conn = mysqli_connect("localhost", "root", "", "vm");
// DELETE QUERY
if(isset($_GET['id'])){
$de=$_GET['id'];
$sql_de="DELETE FROM clt_t1,t2 INNER JOIN t2.Id_clt ON clt_t1.Id_clt=t2.Id_clt WHERE Id_clt=$de ";
$rd=mysqli_query($conn,$sql_de);
if($rd){
header("refresh:1; url=welcomeadmin.php");
}
else{
mysqli_error($conn);
echo "error";
}
}
admin.php page:
<form method="GET" action="deletecomm.php">
..
<td><a href="javascript:delete_data(<?php echo $data['Id_clt']; ?>)">X</a></td>
..
</form>