in reply to hash or tables...


  SELECT * FROM profiles, levels
  WHERE member_id=23
  AND profiles.level_id=levels.level_id
As others have said, do it in the database, but you don't need the AND. Use this:
  SELECT * FROM profiles NATURAL JOIN levels
  WHERE member_id=23
A NATURAL join will automatically join on level_id since it has the same name in both tables, no need for the AND clause.