I need something like this:
The thing is, "something like this" is very vague.
however the array is a mysql array but I can make it work with an musql array
What's a "mysql array" and "musql array"?
This is what I suspect you want to do:
You have a few people values of the "people" column in your houses table. For the username 'Charles', you want to select with these values of the "people" column. As it stands, your idea is to select all the rows that have the username 'Charles', then use PHP to filter out based on the "people" column.
In truth, you can do it all in the SQL statement by getting PHP to generate the SQL statement.
$people_array = array("Peter", "John", "Mary");
$people = "'" . implode("','", $people_array) . "'";
$query = "SELECT * FROM houses WHERE username='Charles' AND people IN($people)";
$result = mysql_query($query);