Change your current site table to: site (siteID, text, url, desc)
Create two more tables: category (categoryID, name) siteCategory (siteID, categoryID) In your form, have either a multiple select or many checkboxes with all the categories. When you submit the form, insert into the site table as you have done already, after the insert, get the newly generated site ID (assuming your siteID column is an identity field), then loop over the category ID form field and insert into siteCategory (the new siteID and each categoryID as you loop). Adrian > -----Original Message----- > From: John Barrett [mailto:[email protected]] > Sent: 12 August 2009 03:34 > To: cf-newbie > Subject: write multiple category to DB > > > Hi, > I am working on a List admin that has a form that write URLs with data > to a db. I am confused on how can I add the category to multiple area. > I have a form that writes to a DB: > The database has > 1) Site name > 2) url > 3) paragraph about what the site includes > 4) Topic areas to place the site. Most urls will go in multiple areas. > > This is done for one category. Okay maybe having 30 different versions > of the same add/delete/update form is not good practice, but I am new > at this. > > So for example I would have Adobe(http://adobe.com), and a description > about adobe. But I would place adobe in many categories, such as > ColdFusion, Flash, Flex, etc. > > So if I have a table for each page that I want to update, I have 30 so > far, how can I write to multiple tables at the same time? > > The DB structure is: > record_id, Text, URL, Disc, Cat > > Any help would be great, > Thanks so much, > John ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4692 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
