i have go through answer in here but i confuse... what is INNERJOIN or LEFTJOIN when delete a data. i have problem to delete same data in multiple table... this example i have
Table user_information contain user_id. primary key
table registration contain user_id
this 2 table, i didn't create foreign key.. i want to delete the row that have specific user_id data.. i try to create this php code
<?php
include ('dbconnect.php');
$matric=$_GET['user_id'];
$sql="DELETE FROM user_information, registration WHERE user_id='$matric'";
$result=mysql_query($sql);
if($result){
header("location:../adminMuser.php");
}
else {
echo "ERROR";
}
?>
<?php
mysql_close();
?>
how to make a delete than when we delete specific user_id it can delete all data that have that user_id in both table. how to use the INNERJOIN or LEFTJOIN or what necessary i need to do... my php just show error
i also try to do this
$sql="DELETE user_id FROM user_information RIGHT JOIN registration ON user_information.user_id=registration.user_id WHERE user_id='$matric' ";
still it just show "ERROR"