view counter, not quite working
<p>I'm trying to make a view counter for my site, but for some odd reason once it counts the first view it doesn't go up anymore </p>

<p>here is the code </p>

<pre><code>$checkViews = "SELECT COUNT (counter) FROM pageViews WHERE chapterID = '".$_GET["chapterNo"]."'";
$result=getQuery($checkViews,$l);
if($result == 0)
{
$viewupdate =  "INSERT INTO pageViews (chapterID, counter) VALUES ('".$_GET["chapterNo"]."', 1)";
$result=getQuery($viewupdate,$l);   
}
else if ($result != 0)
{
$viewUpdate = "UPDATE pageViews SET counter = counter++ WHERE chapterID = '".$_GET["chapterNo"]."'";
$result=getQuery($viewUpdate,$l);
}
</code></pre>
