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

java - Ebean enhancement ignores a model -

ubuntu - How to disable Kernel Module Signing in linux -

SQL php on different pages to Insert (mysqli) -