MySQL check if value exists in another table
I have three tables, one table, vendors, holds a vendor name and an id, the second table, vendorlinks, has two columns vendorID and pageID, the id in vendors has the same value as vendorID in vendorLinks, and the third table page has the column page id which matches up to pageID in vendorlinks.
So basically I have a type of multiple pages correspond to multiple vendors system, and I need to display a page that contains all the pages that correspond to the vendor but also have pageIDs that correspond to the pages table pageId column, as not all entries in vendorlink correspond to a particular page entry.
What I need is a sql statement that will probably look something like this
'SELECT * FROM VendorLink Where vendorID = :venId And' pageId matches with ID IN pages table
That last part is what I don't know how to do. Any help is alwaya aprreciated.