The 1 that I refer to is simply adding 1 to a field in a table, by clicking on a link. This is the link code:
<?php if ($pagina) { ?>
<div class="row">
<div class="col-md-6">
<h3><a href="<?php echo $pagina['url']?>" target="blank"><span
class="hint--top-right" data-hint="Clic aquí para acceder a la web de
la propiedad">PAGINA WEB</a></h3>
</div>
</div>
<?php } ?>
And this is the function I should run:
# ----- Sumar click_website a la propiedad
function addClickWebsite($conexion, $id) {
$consulta = $conexion->prepare("UPDATE alquileres set
click_website=click_website+1 where id=$id");
$consulta->execute();
return $consulta->fetchAll();
}
I need help to link the function to the click on the link, someone told me that I must do it with ajax, but unfortunately I have no knowledge. Thanks.