I'm struggling with some SQL/php syntax issues here.
I'm trying to write two functions.
The first will query a database and return an array of numbers that match specific criteria.
The second will query a database and use the values from the first function to help select the data I'm looking for.
Here's what I have of the first function so far:
$sql = "SELECT requestee_id FROM user_relationships WHERE requester_id = '$uid' AND rtid = '13'";
$resulto = mysql_query($sqlo) or die(mysql_error());
while($rowo = mysql_fetch_array($resulto)){
}
How do I finish this so it returns an array of requestee_id values?
Here's my second query:
$query = "SELECT * FROM {votingapi_vote} vv WHERE ". drigg_votingapi_query('vv', FALSE) ." AND vv.content_type = 'node' AND vv.content_id = %d";
I want to add another WHERE condition to this query, WHERE vv.uid is a value inside the array from my first function. This second function returns a list of people who voted for a story. I want to return, not everyone who voted, but only the people who are friends of a given user.
Suggestions for finishing the first query and fitting it's values into the second one?