Hello
In this script Im trying to write; Im trying to fetch the id of certain users from one table then using the ids that Ive fetched, I want to fetch the users information from another table (the main users table).
However, the trouble Ive run into is that I would have to run double loops to fetch all the information...
Up til now, I have the current code:
$UserIDQry = mysql_query("SELECT * FROM user_subjects WHERE code='$code' AND misc='NULL'");
while($UsersID = mysql_fetch_array(UserIDQry))
{
$UserInfoQry = mysql_query("SELECT * FROM users WHERE user_id='$UsersID[user_id]'");
$UserInfo = mysql_fetch_array($UserInfoQry);
//This is where I am confused as to what to do...
}
Should I run another loop inside the first "while" loop? How should I write it?
Basically all I want to do is grab all the users ids from one table, then using those user ids, grab all the user information from another table and then populate a dropdown list with the users first and last name (gotten from the main users table)
Thanks in advanced for any type of help!