how do you process the data sent via AJAX to your server in PHP:
for example i have the following code:
<?
$input = $_GET["q"];
$data = array();
// query your DataBase here looking for a match to $input
$query = mysql_query("SELECT * FROM my_table WHERE my_field LIKE '%$input%'");
while ($row = mysql_fetch_assoc($query)) {
$json = array();
$json['value'] = $row['id'];
$json['name'] = $row['username'];
$json['image'] = $row['user_photo'];
$data[] = $json;
}
header("Content-type: application/json");
echo json_encode($data);
?>
1) how do i customize this so that i can fetch the usernames of friends of a user on bp1.2?
2) how do i customize this so that i can fetch all the members on bp 1.2?
please help