Hello, I recently started to learn PHP and databases and are working on a school project.
Everything is working great so far, except the part of code where I click the link, the "clicks"(click counter) in database doesnt update the "clicks" part of the table bookmarks with +1 number.
(Everytime I click the link the "133 clicks" should be +1(134 clicks))
And yes, I know it's a messy code 😛
while($row = mysql_fetch_array($result)){
echo "<center><table width=\"300\" height=\"30\" border =\"1\"><tr>";
echo "<td width=\"300\">";
echo "<a href=\"http://$row[link]\" onClick=\"mysql_query(\"UPDATE bookmarks SET clicks = clicks+1 where id = '$row[id]'\");\" target=\"_blank\">$row[name]</a>$row[clicks]<td><a href=\"delete_link.php?name=$row[name]\" alt=\"Delete\" onclick=\"return confirm('Are you sure want to remove $row[name] from your list?');\"><img name =\"Delete\" src=\"/pictures/delete.gif\"></a></td></tr><br /></table></center>";
}
onClick=\"mysql_query(\"UPDATE bookmarks SET clicks = clicks+1 where id = '$row[id]'\");\"
Thanks in advance,
Regards,
Soder.