 <p><code>read</code> is a <a href="http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html" rel="nofollow">reserved word,</a> and so needs to be specially quoted with backticks for it to work in query</p> <p>so try</p> <pre><code>if (!mysql_query("UPDATE $tblname SET `read`='$read' WHERE id='$id'")) { die("update failed with error ".mysql_error()); } </code></pre> <p>Also, the $id value isn't being sanitized in any way, so the code is vulnerable to an SQL injection attack. Definitely worth your time learning about such things.</p>