I've been trying to update more than one column on my database with values that have addslashes. I know addslashes isn't recommended, but is there anyways to add more than one value at a time? I've tried adding another value after a "," but it doesn't work.
example:
$sql = "UPDATE users SET note5=('".addslashes($note5)."'), note6=('".addslashes($note6)."') WHERE user_id=".$_SESSION['user'];
but this does not work.
Any help would be greatly appreciated.
Just remove the brackets around
$sql = "UPDATE users SET note5='". addslashes($note5)."', note6='".addslashes($note6)."' WHERE user_id=".$_SESSION['user'];
Note : I would suggest you to use pdo or mysqli prepared statements, which will remove your extra works needed for special characters.