php - Sending data to server with AJAX? -
i need update table new values in mysql when image clicked.
$("#image1").click(function(){
here's example of query:
mysqli_query($conn,"update photos set rating='$ratingnew1' link='$img1link'");
how execute query when image clicked?
$("#image1").click(function(){ $.ajax({url: "update.php", data: {img1link : 'image link', ratingnew1: 'rating'}); });
and update.php file
<?php mysqli_query($conn,"update photos set rating='$ratingnew1' link='$img1link'") ?>
Comments
Post a Comment