I want to make a code that counts the click on the link which is on my website and adds 1 to the LINKCOUNT
row in the mysql database, but im having trouble over coding.
This is my code when I click the LINK on my website:
mysql_connect("localhost", "123", "123") or die(mysql_error());
mysql_select_db("123") or die(mysql_error());
$result = mysql_query("SELECT id, sitename FROM links WHERE siteurl = \"www\"");
$row = mysql_fetch_array($result);
mysql_query("INSERT INTO links (linkcount) VALUES $row['linkcount']");
$count = 0;
Not sure if that is right way of doing it, any ideas what the code will be?
EDIT
I can now add 1 to the LINKCOUNT row but every link i click adds to the same row, i need each link to have seperate row and click count.