theITvideos Posted August 20, 2010 Share Posted August 20, 2010 I am working on a site, on a shipping profile module that requires users to group the countries into regions to ship the items to. That is: Region 1 - Japan, USA, Spain, Italy. Region 2 - Belgium, France, Germany. I have a table that has all the Country names which will be populated in a Listbox control for users to select. Once the supplier has selected a group of countries from the Listbox, how can I properly save it into the database with its region name. Do I save multiple county IDs with comma or whats the right way. Please advise. The question maybe basic but I need your feedback. Thank you! Quote Link to comment Share on other sites More sharing options...
tomtimms Posted August 20, 2010 Share Posted August 20, 2010 Why not just create a separate table with all the regions and assign them an ID. Then in your countries table put the assigned id into a new column. Table 1: country region table 2 region region_id new table user country region_id Quote Link to comment Share on other sites More sharing options...
theITvideos Posted August 20, 2010 Author Share Posted August 20, 2010 Thanks for the reply tomtimms, It is the Supplier (not the developer) who will create Regions (grouping of countries) at runtime for his products delivery to those countries and we don't know what those countries the supplier will choose from the Listbox. For example, the user creates a tstShippingRegion1 and select the countries for the region under it, i.e : tstShippingRegion1 Germany France Thailand The purpose is to indicate customers that the supplier will only ship items to this region and the countries under it. And for this I need to save this Region information in the database. How do you suggest I do it. Kindly let me know am I on the right track for saving the information in the tables. I need help and guidance. Please send in your feedback. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.