EDIT: PLEASE stop downvoting. Mind you guys, I am very very very very new at this and I am learning on my own, GOD you are unforgiving and possess a special talent at discouraging me, when I need encouragement and support THE MOST, the only place where I can come to ask these questions kicks me right in the gg-uts.
I am trying to register comments inside MySQL database using this combination of PHP and MySQL Query, but I get an error within the SET VALUE statement on variable $comment.
It reads
"Parse error: syntax error, unexpected '$comment' (T_VARIABLE) in C:\xampp\blablabla..."
if (empty($_POST['comment']) === true ) {
echo 'ERGHH ! You cannot do this.';
}
else
//this immediate curly brace ends after the HTML form at the end:
{
if (isset($_POST['comment'])) {
$comment = $_POST['comment'];
$comment = mysql_real_escape_string($comment);
$sql_register_hangout = mysqli_query($conn, "UPDATE hangout_comments SET
(comment, comment_corresponding_hangout_id, comment_corresponding_user_id)
SET VALUES
("$comment", "$hangout_id", "$user_data['user_id']")
WHERE comment_id=".$_POST['comment']);
}
/*
then there's the HTML form with a
input type ="textarea" name="comment"
and a submit button input
followed by a closing }
*/
Q1: Anybody know what am I not doing right?
Q2: Any security holes here or best practice not included in the code? (mind you, I'm still learning through practice, thanks in advance overflowers)