Hi,
Sorry about posting another thread .. but the old thread about the link counter is disapprearing..
Anyhow, the previous post was:
Author: yihung (24.78.144.71)
Date: 2001-04-25 04:12:11
Hi,
Yet another question from me 🙂
Basically, I need a counter for each link that's clicked and insert the new count into a table.
EX:
Say I have 50 records in a table, each record (row) I have a column that contains a link to a detail page. The detail page isn't a real html page, but a pop up window that contains data called from the table...
So, I'll need counts for each clicks on the links and add them to the table, and that counts will be listed together with the records.
I tried this:
if ($action == "profile")
{
$result = mysql_query("SELECT * FROM $table where id = $id", $db);
$counternew = $counter + 1 ;
mysql_query("update $table set counter = '$counternew' where id = '$id'");
now the column named counter can count ONLY once, ie. from 0 to 1.. then it stopped working.. any idea why? as for the counter field, I tried INT, null, default=0.. is that the correct way to do it?