I use ajax to send form data to php script which save this data into mysql table. Here is jQuery
var postAction = $(form).attr('action');
$.ajax({
type: "POST",
url: postAction,
data: $(form).serialize(),
success: function (data) {
}
});
This php script after insert data to mysql return html code.
<?php
$query=mysql_query("INSERT INTO table ('id','name') VALUES ('".$id."','".$name."');
if($query) echo "OK";
else echo "ERROR";
?>
Now i need result of this php script ('OK' or 'ERROR') use in success function.
It is possible?