I am having a problem with MySQL's UPDATE function with PHP. I would post in the MySQL forum but I think the problem lies in my PHP syntax. I'm trying to write a simple message board and it is not updating the number of replies. Here's the line that's not working:
mysql_query('UPDATE topic SET replies=replies+1 WHERE messageID='.$ID.';');
If I use an actual integer instead of concatenating the strings (e.g. "messageID=1;") it works. Also, another update statement:
mysql_query('UPDATE message SET next='.$msgid.' WHERE messageID='.$lastMsg.';');
which also contains concatenated strings works perfectly. the syntax in the two statements is nearly identical. can anyone identify my problem?