I recentely started teaching myself PHP/MySQL and I'm not too happy with my learning curve so far. I've got 4 books and it's still very confusing. The first project I'd like to do is create a web site that will display the latest news on specific cars.
Each news item may be related to multiple makes/models (eg: Nissan Xterra) or just the manufacterer (eg: Nissan)
Ultimately, I want my visitors to be able to choose a specific make and model and see the related news items associated with it. I will be entering and updating all of the news through an online form.
Well, here is where my problem lies. I'm kinda confused on how to create a form where I can enter the news items and have the information inserted into the correct tables at the same time.
Here is what I think my tables should look like:
News Table:
newsid | headline | date | body
Cars Table:
carid | make | model
News Cars Table
newscarsid | newsid | carid
So here is my question. How do you make a form that let's you enter a news item and specify the make/models that it is associated with? I'm really confused on how to do this. Basically, the form has to be able to insert data into the News Table, then it has to insert data into the Cars Table AND know what the newsid is when entering into that table.
I hope this makes sense. Any suggestions would be greatly appreciated.