I have a script that counts the visits on my web pages and stores mysql, however, it is adding 24
clicks to each access, instead of 1
.
What's wrong with this code?
See the script:
<?php
$idcategoria = 19;
if (!empty($idcategoria)){
$guiacomercial_cliques=mysqli_query($con,"Select cliques FROM
cliquesguia WHERE categoria =".$idcategoria);
if (mysqli_num_rows($guiacomercial_cliques) > 0){
$painel=mysqli_query($con,"UPDATE cliquesguia SET cliques =
(cliques + 1) where categoria =".$idcategoria);
}else{
$painel=mysqli_query($con,"INSERT INTO cliquesguia (categoria,
cliques) VALUES (".$idcategoria.", '1')");
}
}
?>