JQUERY
$.ajax({
url: 'save.php',
type: 'POST',
success:function ()
var id = html.$id;
var name = html.$name;
alert(id);
alert(name);
});
SAVE.PHP
<?php
include("db.php");
$sql = "INSERT into test(Name)values('') ";
if (mysql_query($sql))
{
$id = mysql_insert_id();
echo $name = "Peter";
echo $id;
}
?>
How can retrieve specific data and store in a specific variable in my Jquery? Please ignore my Name in php, because I just randomly assign variable to it
How to return two different data, and store them in 2 variable?
I know it is incorrect, please tell me the correct way of doing it