I have PHP code inside jQuery scriptm, and I want to pass a jQuery variable to PHP.
This is my code :
$(document).ready(function() {
$('.editclass').each(function() {
$(this).click(function(){
var Id = $(this).attr('id');
<?php
include "config.php";
$query="SELECT * FROM users WHERE UserId=\'id\'";
?>
$("#user_name").val(Id);
});
});
});
I want the value of id to be exist in php code ($query
)