Hey guys,
I'm learning PHP (slowly) to replace phpNuke (yeah, I know) as the main system to operate my site. I'm currently writing a Reviews module.
Under some advice I've been changing the structure of my Reviews table so that I have a seperate table for Staff, who write the reviews. I've just added in a dropdown box on the reviews submission form, which looks up the $name values in the Staff table, and stores the selected staff member's $id in the Reviews table under 'author'. So far so good?
Now when I come to display the review itself, I have problems. Before, I just had php query the Reviews table, which contained the $Reviewer_Name value for each stored review. Now what I need to do, is basically tell php to:
Lookup the $author id stored in the Reviews Table, and display the relevant data associated with that $id on the page.
That on its own sounds simple, but the only way I can think of doing this is to select all the values from the Staff table, then display the relevant one. Is there a way to query it in such a way that it takes the $author id value stored in the review and then queries the Staff database just for that $id rather than everything? I'm just not sure how to write a query like that on the same page that already looks everything up for the review based on the URL (review.php?id=$value).
Sorry if this was a little wordy for a simple problem, I had to try to get my head around it as I wrote it..