I hope this is the right place to ask this question.
I need to update some NULL fields that were accidentally introduced in a table. I have pulled the users' email addresses with a recordset from the users table and want to update them in the table.
The query for the update is :
$query_repair = "UPDATE tickets SET tickets.user_email = {$row_rsUsers['user_email']} WHERE tickets.UserID = {$row_rsUsers['id_usr']}";
When printed out the query resolves as follows:
UPDATE tickets SET tickets.user_email = example@example.com WHERE tickets.UserID = 1
However, when passed to MySQl I get:
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 '@.net WHERE tickets.UserID = 1' at line 1
It seems to be choking on the user's email address at the @ sign.
Do I need to enclose this another way?
Thanks.