I have written a php script
cch.php
$stmtcheck = $mysqli->prepare("SELECT id FROM members WHERE email=? AND unlock_code=?");
$stmtcheck->bind_param("si", $_SESSION['unlockemail'], $_POST['code']);
$stmtcheck->execute();
$stmtcheck->bind_result($id);
$stmtcheck->fetch();
$stmtcheck->close();
And jquery for submitting form is
recover.php
$("#formUnlock").submit(function(e)
{
e.preventDefault();
$.ajax(
{
url: '../scripts/cch.php',
method: 'POST',
data: $(#formUnlock).serialize(),
success: function()
{
alert("unlocked");
}
});
});
Now what I want to check whether $id has some value or not! How would I fetch the $id variable to my main script?
echo !empty($id)? 'y' : 'n'