I’m having trouble getting my brain around the (Inner?) Join used in a db query in MySql. Can someone help me with this? Here’s what I need to do:
presscategoryID*
presscategoryName
presspublishID*
presspublishDate
pressID
pressPublish (*presspublishID goes here)
pressCategory (
pressTitle
…
Here’s the first query:
SELECT * FROM presspublish ORDER BY presspublishDate DESC
…
$pressPublish = $row[‘presspublishID’];
Here’s the second query (within the first query):
SELECT * FROM press WHERE presspublish=$pressPublish
I need to modify the second query so that I can list the results by presscategoryName. BUT NOT ALL PRESSCATEGORIES WILL BE USED EVERYTIME. SO I NEED TO ONLY SHOW PRESSCATEGORIES WITH PRESS ASSOCIATED WITH THEM. For example:
01/28/05 (presspublishDate)
Automobile (presscategoryName #1)
* Article #1 (pressTitle #1)
Home (presscategoryName #3 — #2 has no related articles this date)
* Article #1 (pressTitle #3)
…
I hope this explains it well. Any help will be greatly appreciated. Thank you so much!