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

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -