Hi, I currently have this: mysql_query("UPDATE drink SET `count=count+1` WHERE id = '$_GET["id"]'"); PHP: What is wrong with it? Thanks
The backticks have to go around the field name only. The $_GET variable with the double quoted key will cause a parse error. The variable is (seemingly) not filtered and could allow SQL injection. Try this instead. mysql_query(" UPDATE drink SET `count` = (`count` + 1) WHERE id = " . intval($_GET["id"]) ) OR die(mysql_error()); PHP: (Assuming $_GET['id'] will always hold a numeric value.)