General discussion
how to update multiple sql columns

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'smile {

        $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 { }
114
0
6
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft