Here is my code but im sure its not the correct way of doing this.
mysql_query("SELECT * FROM BlockUsers
WHERE OwnerID =
(SELECT ID FROM UserAccounts WHERE Code='$UserCode')
AND
BlockID =
(SELECT ID FROM UserAccounts WHERE Code='$BlockUserCode')
LIMIT 1", $DB)
Can someone help? thanks!
Yes, but when you’re doing an equality test like that (=, <, >, etc…), the subquery has to return a single value. Otherwise it’d be
somevalue = [list of result rows], which makes no sense.You’d want: