How can I put the results of a mysql select query into an array, for example all the id fields that are not active? This array will then be used in another select query to "not" get any rows with the id's from the first query. The second query will only get the first matching result. example of query 1: mysql_query("SELECT id FROM users WHERE active='No'"); example of query 2: mysql_query("SELECT * FROM data WHERE id!='".$MyArray."' LIMIT 1"); So, where I am lost is on how to code the array and if the mysql query will work correctly using an array.
This can be done with a sub query: SELECT * FROM data WHERE id NOT IN (SELECT id FROM users WHERE active='No') LIMIT 1 Code (markup): or a standard join: SELECT data.* FROM data, users WHERE data.id = users.id AND users.active = 'No' LIMIT 1 Code (markup): Brew