I have a question in getting values from two tables and checking to see whether they are equal.
The first table is called "A".
The second table is called "B".
Users get assigned a group_id number associated with their user_id in table "B". If they have been granted access to a particular forum, then that group_id is inserted into "A".
The administrator wants to see who has been given access and who hasn't.
I have been trying this for the past 3 hours and I can't get it.
in PHP it would be:
is there another way of querying the two tables?? what am i doing wrong?
arif
The first table is called "A".
The second table is called "B".
Users get assigned a group_id number associated with their user_id in table "B". If they have been granted access to a particular forum, then that group_id is inserted into "A".
The administrator wants to see who has been given access and who hasn't.
I have been trying this for the past 3 hours and I can't get it.
in PHP it would be:
Code:
$sql = "SELECT group_id FROM B LEFT JOIN A ON B.group_id=A.group_ID";
$result = mysql_query($result);
if ($row = mysql_fetch_array($result)) {
print "yes";
} else {
print "no";
}
is there another way of querying the two tables?? what am i doing wrong?
arif