php update database with ajax
I want to help with my code.i am just not able to find out that is it a php problem or java scripts.
can i send something value like this in java script. i want to update my friends name so i need both id and friends value
and my ajax.js
$id = $_REQUEST['id'];
$query = "UPDATE friends set friends='".$friends."' where id='$id'";
document.getElementById(id,friends).innerHTML = "<em>editing...</em>";
http.onreadystatechange = insertReply1;
can anyone help me with my code? now the status is record is getting empty as soon as i fire the query. i dont want to delete record but want to update it. it seems friends value is not getting passed through my JS.
thanks in advance