Thanks that works, but I have a small issue again.
I need to filter a recordset twice. It need to filter based on a UserID in a form field on the page, and the UserID of the logged in user to see if the database table contains a record with both the users. Hence, they are friends already.
My plan was then to use "show if" to display messages. However I cannot make it work. Is my SQL incorrect?
SELECT *
FROM friends
WHERE UserID = colname AND FriendID = colnamem
colname
$_POST['AddFriend_UserID']
colnamem
$_SESSION['UserID']