I hope I am doing this correctly..
Using this code I am grabbing records from one table and storing them in an array:
$result = mysql_query("SELECT username FROM '$tbl_name'");
$storeArray = Array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$storeArray[] = $row['username'];
}
The result of the query is (using: print_r($storeArray);
):
Array ( [0] => username1 [1] => username2 [2] => username3)
I want to use this array to search another table. Improvised code would be:
SELECT * FROM $users_tbl WHERE username = username1, username2, username3
Could anyone help me generate the MySQL query that would do this?
I hope this is clear enough..