Different table data confusion
Posted: Fri Mar 02, 2007 6:32 am
Hi
I'm hoping you can point me in the direction I should be taking as I'm confusing myself at the moment!
I have two tables in a database. One is a list of articles, one is a list of categories for those articles.
I have a form for the user to enter a new article which pulls the list of categories and displays it in a select box for the user to choose as they add the article. This then submits the chosen category name to the table for the list of articles along with the text and title etc.
That all seems to work fine.
I'm getting myself confused as to how best to organise the edit form for these articles.
The Edit form pre-populates a form with the details taken from the articles table including currently a simple input box with the previously chosen category included all from the articles table.
But I'm not sure how to combine that with the previously used select list of categories from the existing category list AND have the chosen category showing in the select box.
How do I show the select box options of all the categories from the category list with the category in the article list showing?
Any advice welcomed!
I'm hoping you can point me in the direction I should be taking as I'm confusing myself at the moment!
I have two tables in a database. One is a list of articles, one is a list of categories for those articles.
I have a form for the user to enter a new article which pulls the list of categories and displays it in a select box for the user to choose as they add the article. This then submits the chosen category name to the table for the list of articles along with the text and title etc.
That all seems to work fine.
I'm getting myself confused as to how best to organise the edit form for these articles.
The Edit form pre-populates a form with the details taken from the articles table including currently a simple input box with the previously chosen category included all from the articles table.
But I'm not sure how to combine that with the previously used select list of categories from the existing category list AND have the chosen category showing in the select box.
How do I show the select box options of all the categories from the category list with the category in the article list showing?
Any advice welcomed!