Kindly do have a look at below mentioned SQL:
$sql ="INSERT INTO
demo_participant
(name, meeting_id_id, password, user_view__url, key, contact_no, email)
VALUES
('$part_name', (SELECT id FROM demo_meeting WHERE meetingID = '$mtngid'),
'$attendee_password', '$join_url', $getit_part['data'], '$pr_mobile',
'$pr_email')";
My problem is the above statement is working fine without key and its associated value $getit_part['data']
But whenever I am trying to store key value I am getting the error i.e:
Parse error: syntax error, unexpected ” (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /opt/lampp/htdocs/UI/user/joinmeeting.php on line 86
And when I am storing the value of $getit_part['data'] in another variable like $key then I am getting:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘key,contact_no,email) VALUES(‘Rohitn’,(SELECT id FROM demo_meeting WHERE ‘ at line 1
I know I am doing some syntax error but unable to debug it.
keyis a reserved word in MySQL. escape it with backticksand you can’t combine
selectandvalues. Try