select visits.* from visits join ads on visits.aid = ads.id where ads.uid = 1;
It will return all visits where the ad belongs to user with uid = 1
.
If you’re only seeing one row, make sure there’s no LIMIT 1
and that your table has more matching data.