Hey everyone.
I'm re-writing a php Content Management System (based loosely on
phpNuke but specific to my site). My first major change was attempting
to normalise the Review section database structure. I've created a
Staff table with staff email addresses and names (plus id), and a
Reviews table with the text of the reviews. The Reviews table contains
an 'author' field with a value that corresponds to the Staff table.
When I display a review, I successfully used an Inner Join to link the
records and display the correct author name/email for the relevant
review.
My problem now is when editing the reviews. I originally had a basic
php page that simply selected the values and loaded them into a form,
but I can't get this to work now. Specifically, In the Submit form for
Reviews, I created a dropdown box which loaded the values from the
Staff table. When storing a review, it correctly stores the value for
the selected Author's ID in the Review table. My problem is when
editing the review, I cannot get php to lookup the author ID in the
Reviews table, then display in the dropdown the correct Author Name
from the Staff table for that specific review.
Could anyone help? The MySQL manual for joins may as well be written in
Greek.
Matt
I'm re-writing a php Content Management System (based loosely on
phpNuke but specific to my site). My first major change was attempting
to normalise the Review section database structure. I've created a
Staff table with staff email addresses and names (plus id), and a
Reviews table with the text of the reviews. The Reviews table contains
an 'author' field with a value that corresponds to the Staff table.
When I display a review, I successfully used an Inner Join to link the
records and display the correct author name/email for the relevant
review.
My problem now is when editing the reviews. I originally had a basic
php page that simply selected the values and loaded them into a form,
but I can't get this to work now. Specifically, In the Submit form for
Reviews, I created a dropdown box which loaded the values from the
Staff table. When storing a review, it correctly stores the value for
the selected Author's ID in the Review table. My problem is when
editing the review, I cannot get php to lookup the author ID in the
Reviews table, then display in the dropdown the correct Author Name
from the Staff table for that specific review.
Could anyone help? The MySQL manual for joins may as well be written in
Greek.
Matt
Comment