How do I create a query that updates a field called "views" in a table called "table" and increase "views" by 1 WHERE the id = '1'?
Basically, how do I simplify this query?
$sql = "SELECT * FROM `table` WHERE `id` = '1' LIMIT 1";
$query = mysql_query($sql);
$row = mysql_fetch_array($query);
$views = $row[views];
$views++;
$sql = "UPDATE `table` SET `views` = '$views' WHERE `id` = '1' LIMIT 1";
mysql_query($sql);