Hi I'm trying to start a dating site and need help with an SQL statement. Basically all the members would be shown when searched for except for those who have blocked the member that is visiting and searching. I'll know who the member that's visiting is by capturing is username with php $_SESSION['username'] and also his IP address.
These are the columns in the tables I have...
members
id,
username,
photo,
ip
blocked
id,
name_of_banned,
ip_of_banned,
banned_by
member_id_of_banned_by
so basically select all from members except for the members appearing in the
"banned_by" column of the blocked table that also have named_of_banned = to the current $_SESSION['username'] or the ip_of_banned = to the current users IP (I'll use $_SERVER['REMOTE_ADDR'])
Please note I want to be able to check by both $_SESSION['username'] and $_SERVER['REMOTE_ADDR'] since perhaps the user that's banned may be browsing whilst not logged in.
many thanks
juanc is online now Report Post Edit/Delete Message