I have a jQuery AJAX function like this:
$.ajax({
url: 'crud/clients.php',
dataType: 'json',
type: 'POST',
data: {
id:rowID,
clientID:$('#clientID').val(),
clientName:$('#clientName').val()
}
success: function(data){
alert(data);
}
});
I then setup my query in the clients.php file. Finally, I execute the query with this line:
mysql_query( $sql ) or die(mysql_error());
How do I return the results of that query in JSON format so that my AJAX function can catch whatever is returned?