View Single Post
Old 04-17-2008, 07:27 AM   #27 (permalink)
Kargon
Registered User
 
Join Date: Aug 2002
Location: Durham, NC
Posts: 139
Send a message via ICQ to Kargon
You would query for the keyword used for the particular company, and then use that to query for the log entry...

SELECT log1 FROM table_3 NATURAL JOIN table_1 WHERE keywordID = $key; ($key is what you just selected)

or something along those lines. It could be a left or right join, natural join is just the easy opt out as I just woke up and can't think =/ It joins the two tables where
the CompanyIDs match, so you have a list of different keyword IDs for the same companyIDs and can just pick off the data from there. Additionally, since the SELECT statement
used to find the keywordID will probably return multiple entries, this query should be executed in a while loop. (for each keywordID). Hopefully this wasn't too retarded.


p.s. the definition of a primary key is that it is unique (i.e. it does not repeat)
__________________

Last edited by Kargon : 04-17-2008 at 07:46 AM.
Kargon is offline   Reply With Quote

 
Uberguilds Network