Jquery Ajax Call inserts new record on DB. File been called (php) needs to return two values, the contents of the insert and it's id.
How should I send back these values (array, xml, echo) on php?
How will I separate these in the Jquery Ajax success (data)?
Currently the processing php file returns only one string being the inserted content with which I then update view. Need to return the record id so i can wire the element.
Please advice if this needs more clarification. Thank You
JQUERY
$.ajax({
type:'post',
url: 'posts_in.php',
data: $("#postentry").serialize(),
success:function(data){
var id='posts';
//split returned data here
$('<div></div>').attr('id',id).addClass('boxee').html(data).prependTo('#boxer');
$('#tittle_ent').val('').focus();
}
PHP
echo $value1,$value2;
print_r($arrayhere);
XML ?