Hey guys!
I have read somewhere that the way to update multiple sql columns would be to add a coma? I can't get this code to work and it should update two subscriptionplans for the user instead of just one..
if ($subscriptionplan == 'Level 1' && $row['subscriptionplan'] == 'None' && $subscriptionplan2 == 'Level 2' && $row['subscriptionplan2'] == 'None' && $subscriptionplan3 == 'None' && $row['subscriptionplan3'] == 'None'
{
$sql = "UPDATE memberships
SET subscriptionplan = '$subscriptionplan', subscriptionplandate = now(), fees3 = $fees3, paid = $paid, expirydate = now() + interval '1' day, paidbydate = now() + interval '1' day, overdue = $overdue, totalfees = $totalfees, subscriptionplan2 = '$subscriptionplan2'
WHERE user_uid = '".$_SESSION['u_uid']."'
";
mysqli_query($conn, $sql);
header("Location: update.php?subscription=success");
exit();
} else {
}
Hey guys!
I have read somewhere that the way to update multiple sql columns would be to add a coma? I can't get this code to work and it should update two subscriptionplans for the user instead of just one..
if ($subscriptionplan == 'Level 1' && $row['subscriptionplan'] == 'None' && $subscriptionplan2 == 'Level 2' && $row['subscriptionplan2'] == 'None' && $subscriptionplan3 == 'None' && $row['subscriptionplan3'] == 'None') {
$sql = "UPDATE memberships
SET subscriptionplan = '$subscriptionplan', subscriptionplandate = now(), fees3 = $fees3, paid = $paid, expirydate = now() + interval '1' day, paidbydate = now() + interval '1' day, overdue = $overdue, totalfees = $totalfees, subscriptionplan2 = '$subscriptionplan2'
WHERE user_uid = '".$_SESSION['u_uid']."'
";
mysqli_query($conn, $sql);
header("Location: update.php?subscription=success");
exit();
} else {
}