check the response of a php function
I'm stuck!:(
When I click on a link I have this event:
-
$.ajax({type: "POST",
url: "/req.php",
asynchronous: false,
dataType: "xml",
data: "jQuery=1"+
"&op=attivaProva"+
"&modulo=statistiche",
success: function(risultato){
if (risultato) {
jAlert('Attivazione eseguita con successo', 'Complimenti!', function(){
window.location.reload();
});
}else{
jAlert('Error','Error');
}
}
});
The php file check the "op" and call a function that return true (if the query is ok) or false (if the query is not ok). What I have to do to test this value? I mean....jQuery make the sync call, call the php script that run a INSERT query. I need to test in jquery if this QUERY was correctcly lanced. I try with the code above but I can understand that the success parameter is only for the good call of the php script, not for the response.
What I have to do?
Thanks