Adding Page Counter to Each Classified Ad
<p>I am trying to add a page counter to each classified Ad just like to one on ebay for example. There is a page counter that increases whenever a user clicks on an item.</p>

<p>Here is why I have a problem:</p>

<p>itemlist.php</p>

<pre><code>$query="SELECT post_id, title FROM md_post WHERE category='cars' ORDER BY timeStamp desc";
$result= mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($result)){
echo "&lt;a href='itemdescription.php?id=".$row['post_id']."'&gt;". $row['title']."&lt;/a&gt;";
</code></pre>

<p>so When I click on an item title with id of 3, i would be direction to the <code>itemdescription.php?id=3</code></p>

<p><strong>My problem</strong> is when I add a page counter to itemdescription.php, I get a counter that increments even when I click on different items. </p>

<p>the counter will be 1 for <code>itemdescription.php?id=3</code>
and 2 for <code>itemdescription.php?id=4</code></p>

<p><strong>I want each ad to have a stand-alone page counter</strong></p>

<p><strong>UPDATE:</strong>
Sorry I did not include the code for itemdescription.php page since there is no much in it. Here it is: </p>

<pre><code>    &lt;div id="content"&gt;

&lt;?php




$query="SELECT  name, email, category, region, city, title, price, description FROM md_post WHERE category='cars' AND post_id='$_GET[id]'";

$result= mysql_query($query) or die (mysql_error());

$row = mysql_fetch_array($result);

echo $row['category'] . " in ". $row['city'];

echo $row['title']. " - price is -". $row['price']."$"."  ". "&lt;br /&gt;&lt;br /&gt;";

echo "description"."&lt;br /&gt;&lt;br /&gt;";
echo $row['description']; 
echo $row['name'] . " - ". $row['email']. " region:". $row['region'] . "&lt;br /&gt;&lt;br /&gt;";
</code></pre>

<p>This page is only displaying the ad. e.g. displaying info like price, title, city ...etc</p>

<p>I want to include a stand-alone page counter at the bottom of this page, but when I tried, the counter was not unique for a specific item/ad. It was shared by all items/ads</p>
