Below is a common call that I am using in javascript to perform some SQL operation on the server. When the data.php script encounters an error (syntax, sql syntax), I don’t know how to display there was a problem when php reports a problem. How does one display the php error in the ‘error’ part of the php call?
steven
$.ajax({
dataType: ‘json’,
url: ‘data.php’,
data: data,
cache: false,
success: function (data, status, xhr)
{
// insert command is executed.
commit(true);
},
error: function (jqXHR, textStatus, errorThrown)
{
commit(false);
}
});