Ive read multiple answers but none seem to work for me.
I have two tables Cus_acc_details & Cus_Register:
Cus_acc_detail
1 : CustomerID
2 : Acctid
3 : CUS_Fname
4 : Cus_Lname
5 : CUS_Phone
6 : Cus_Email
Us_Register
1 : Cus_Email
2 : Cus_Password
3 : Cus_confirm_Password
I want to update all fields from Cus_acc_detail and only Cus_Email for Cus_register. I have the following :
<?php
$user = $_SESSION["Cus_Email"];
if (isset($_POST['Update'])) {
$UpdateFname = $_POST['fname'];
$UpdateLname = $_POST['Lname'];
$UpdateEmail = $_POST['email'];
$UpdatePhone = $_POST['phone'];
}
$sql = $dbc->query("UPDATE Cus_Register r INNER JOIN Cus_acc_details d ON( r.Cus_Email = d.Cus_Email) SET CUS_Fname = ' $UpdateFname', CUS_Lname = ' $UpdateLname', CUS_Email = ' $UpdateEmail', Cus_Phone = ' $UpdatePhone' WHERE CUS_Email = '$user' ");
header('Location: Cus_Account.php');
?>
The page simply just does not update, could someone possibly point out where i have gone wrong.