0
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?
Look at 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')");
}
}
?>
Take advantage that you edited the question and put the database structure, describe how you are executing the code and how you identified that it is added 24.
– Woss
Let me check my Horns!!! They say the problem is in such a $q=@file_get_contents($ssite); which is in your code :)
– user60252