I want to help with my code.i am just not able to find out that is it a php problem or java scripts.

HTML Code:
 <a href="javascript: edit(<?=$row['id'];?>,<?=$row['friends'];?>);" title="edit">Edit</a></span>|
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

PHP Code:
$id $_REQUEST['id'];
$friends =$_REQUEST['friends'];
$query "UPDATE  friends set friends='".$friends."' where id='$id'"
and my ajax.js
Code JavaScript:
function edit(id,friends){
document.getElementById(id,friends).innerHTML = "<em>editing...</em>";
              http.open('GET', 'edit.php?id='+id+'&friends='+friends);
 	     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