I tried to make a click counter in MySQL, but it dose not seem to work.
Here’s my code in PHP (count.php)
<?php
mysql_connect("myhost", "username", "password") or die(mysql_error());
mysql_select_db("mydatabase") or die(mysql_error());
mysql_query("INSERT INTO `table` (`field`) VALUES(\'+1\'); ")
or die(mysql_error());
?>
And here is the HTML
<html>
<head>
</head>
<div onClick="count.php">Click!</div>
</script>
</body>
</html>
And will this code handle multiple people clicking the button at the same time?
onClick is not like href, it shoud look like this:
in count.php instead of
you can use