Alright, I've been coding in PHP and MySQL for about a year now and I feel like I've done this very query a million times, but all day today I've been running into errors.
The table name is title_transfers
, the column I'm editing is read
, and the column to
represents the person receiving a transfer. $userfinal
is the session name. If the "read" column is "no", a notification appears on the home page, alerting the user of a transfer to him/her. When they view the page the following code is at the top of, the read column of any transfer to that person is changed to "yes" so that the notification no longer appears on the home page. The code is as follows:
mysql_query("UPDATE title_transfers SET read=yes WHERE to=$userfinal") or die(mysql_error());
The error I've been receiving:
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 'read=yes WHERE to=RapideGT' at line 1
RapideGT is the test username/session name. I've tried everything; I can't understand why it's not working. I've noticed this type of thing happening a lot after I upgrade to VPS, if that helps. Any input is appreciated!