Hello,
I am trying to replace 2 queries by 1, but don't know if it's possible:
$result=mysql_query("SELECT nickname FROM usertable WHERE id='$id'");
$result=mysql_query("SELECT expiration FROM blacklist
WHERE blacklisted='$id' and blacklisted_by='to'");
I could use this query to check if user exists in blacklist table
$resultc=mysql_query("SELECT
usertable.nickname,
blacklist.expiration
FROM usertable left join blacklist on usertable.id = blacklist.blacklisted
where usertable.id = '$id'
");
but the problem is that this $id may be blacklisted by many users and in blacklist table may be many rows where blacklisted='$id'. I need something like:
[FONT="Courier New"]...left join blacklist on usertable.id = blacklist.blacklisted and blacklist.blacklisted_by='$to'
where usertable.id = '$id'....[/FONT]
Is it possible in one query?
Thanks.