SELECT * FROM ad, user WHERE user.userID = ad.userID AND adID = login;

Неправильный запрос