Experienced newbie humbly requests asssistance...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
richardinthemoment
Forum Newbie
Posts: 2
Joined: Mon May 05, 2008 11:53 am

Experienced newbie humbly requests asssistance...

Post by richardinthemoment »

Hello there...

I am creating a database with the following three tables:

One: Categories (Id, CatName)
Two: Subcategories (ID, ParentID, SubCatName)
Three: Articles (CatName, SubCatName, ArtName, ArticleURL)

As I ask these questions, note that I am not new to technology (I’ve worked with Access/ASP) but I am a brand newbie to MySql/PHP. (I know how to create the dbase connections, the dbase, statically add data to the database, and create a form.)

What is the best way to create the ParentID for the subcategories field. Is it just a plain numeric field or do I need to reference the Categories database somehow (same question applies for CatName and SubCatName in the Articles database)?

Tables 1 and 2 will be relatively static. Table 3 will be updated by an online form. How do I create this form so that I will have dropdown lists for the category and subcategory choice and then submit this information back to the table articles in the database?

I have done about 3 hours of online research but everyone seems to have a slightly different method. Thanks in advance for your help,
Richard


Note: I would prefer not to use the javascript option for the dropdowns in case people don’t have javascript enabled. Thanks again, Richard

One last note: It is possible that a category might not have any subcategories….
Thanks,
Richard
AXEmonster
Forum Commoner
Posts: 34
Joined: Fri Sep 05, 2003 11:27 am
Location: newcastle UK

Re: Experienced newbie humbly requests asssistance...

Post by AXEmonster »

have you setup your table id's as auto-increments
AXEmonster
Forum Commoner
Posts: 34
Joined: Fri Sep 05, 2003 11:27 am
Location: newcastle UK

Re: Experienced newbie humbly requests asssistance...

Post by AXEmonster »

have you setup your table id's as auto-increments
richardinthemoment
Forum Newbie
Posts: 2
Joined: Mon May 05, 2008 11:53 am

Re: Experienced newbie humbly requests asssistance...

Post by richardinthemoment »

Yes, table IDs are auto increment...
Post Reply