I have two tables in the database.
One table is called user_group and the other auth_access. I have to check when the group_id column in both tables is equal. If they are equal, then 'yes' is displayed, otherwise 'no' is displayed.
The user_group table also has a user_id column. The user_id is associated with a group_id which is the same group_id in the auth_access table.
My SQL query is like this
$sql = "SELECT user_group.group_id FROM user_group LEFT JOIN auth_access ON user_group.group_id=auth_access.group_id WHERE user_group.group_id=auth_access.group_id";
$result = mysql_query($sql);
$row = @mysql_fetch_array($result);
however, no matter what the group_id in the user_group table, even when it doesn't exist in the auth_access table, yes is being displayed
can someone help?
thanks
arif
Then when I have to display the text, I have:
if ($row2) {
<td><font face="Verdana, Arial" size=2>yes</font></td>
<? } else { ?>
<td><font face="Verdana, Arial" size=2>no</font></td>
<? } ?>