I'm trying to do a mysql_query(); and if that's successful I wan't to do another one, which has to update a field in another table.
My mysql_query(); code looks like this:
$query = mysql_query($sql)or die(mysql_error());
if($query){
$sqlU = mysql_query("UPDATE lookup SET lookupStatus=1 WHERE lookupId=".(int)$post['FK_lookupId']."");
return true;
}
The $sql which is not provided in the question is just a simple INSERT statement.
The $sqlU UPDATE statement is not even run.
P.S: I think the problem is that it's running through a jQuery AJAX, and therefore when the first mysql_query(); returns true, it's cutting off the rest of my PHP.
My jQuery:
$('#lookupAnswerGo').submit(function() {
var dataString = $(this).serialize();
$.ajax({
type: "POST",
url: "/includes/classes/handler.php?do=addLookupAnswer",
data: dataString,
success: function(returnedData){
if(returnedData){
$('.errorMessage').fadeIn().html(returnedData);
} else {
window.location.href = "";
}
}
});
return false;
});
If I'm right about the problem is AJAX, then how do I prevent it from cutting off my PHP?