Ok, here it is. Someone must know how to fix my prob, im sure of it. Well here it is. I am creating a tutorials page and I want php to "print" how many times a tute has been read, this is what I have (not including the display of the tutes and stuff, just the number part for how many views):
<?php
$user="user";
$pass="pass";
$db="database";
$link=mysql_connect("localhost",$user,$pass);
if(!$link)
die("Couldn't connect to MySQL.");
mysql_select_db($db,$link)
or die("Couldn't open $db: ".mysql_error());
$result=mysql_query("SELECT * FROM tutorials WHERE $views=views AND WHERE id=$id");//$id will be read from hyperlink
$newview=$views+1;//$newview is suppose to display total number of reads of that tutorial
$query="UPDATE tutorials WHERE id=$id (views) values ($newview)";
mysql_query($query);
print"$newview";//suppose to show total number to reads/accesses to that tutorial
mysql_close($link);
?>
It keeps jsut printing out the number 1. Go to www.acidsun.com/tutorials1.php to see what I am talking about (all you will see is the number 1). And if you reload the page it is suppose to add the number 1 to the previous number which would make it 2, than 3 and so on. If there is a really easy and better way of doing this please do tell.