I have two tables from which I need every row from one table and only those rows equal from the other. Here is the query that I'm using.
$getlist = "SELECT sponsorlistings.tfnlistingid, sponsorlistings.listingtitle, sponsorlistings.listingurl, sponsorlistings.listingdesc, sponsorlistings.bannerurl, sponsorlistings.tfnsiteid, sponsorlistings.sponsorid, sponsorlistings.listingapprv, sponsorlistings.cattypeid, categories.cattypedesc FROM categories LEFT JOIN sponsorlistings ON categories.cattypeid = sponsorlistings.cattypeid WHERE sponsorid = ".$asponsorid." ORDER BY cattypedesc";
This returns the records from both tables where the cattypeid field is equal.
I need a list of ALL cattypeid's and ONLY the records from sponsorlistings where the cattypeid fields are equal.
What needs to be done to the query to achieve this?
Mr. Grammar