1
I am doing a function to change the count of visits on my site. The function is this:
function visitas($conexao, $visita) {
$query = "update visita set visitas= visitas + 1";
return mysqli_query($conexao, $query);
}
But I don’t know how to make him count the visit automatically when viewing my site. Can anyone help me? Thanks in advance!
If I understood correctly, just call the function. Something like
visitas($conexao, null)
- the second parameter leftnull
because he’s not even needed in the job.– Woss
Thank you very much Anderson
– Francis Vagner da Luz
I didn’t understand why calling a function to count visit automatically at the time of viewing. It wouldn’t be enough just to run the query?
– user60252
I am a layman....
– Francis Vagner da Luz
quiet, we are here to help us
– user60252
Thank you @Leocaracciolo
– Francis Vagner da Luz
I don’t know if you’ve seen this post https://pt.meta.stackoverflow.com/questions/1078/como-e-por-que-aceitar-uma-resposta/1079#1079
– user60252
Opa.. vi no... I will take a look @Leocaracciolo, thank you very much!
– Francis Vagner da Luz