First you need to get the value of the $views variable, be it from a file or DB. Then you can use $views++ to increase it by one. After that, you could use this to add it to the DB after you have connected to the database:
$query="INSERT INTO $table (views) VALUES ('$views')";
mysql_query($query);
I think that'll work.....