Jump to content
Larry Ullman's Book Forums

Planning Out A New Site


Recommended Posts

Hi everyone,

 

I am creating a print site with various printing items. I am planning out the site and I have a few issues that I need help with.

 

With every product that I sell (be it business cards, flyers, posters etc) I need to have either a check box / tick box for an option to have a design made.

 

Each of the designs varies in price according to item (business cards, flyers, posters etc).

 

How would I go about planning this out in the database, so that they match the correct product?

 

I hope this makes sense to someone?

 

Thanks inadvance,

 

Ben.

Link to comment
Share on other sites

I don't know the details of what you're thinking, but maybe something like the following:

 

1) Have a table for categories (i.e., business cards, flyers, posters, etc.).

2) Have another table for specific items, which would contain a foreign key that links to the IDs in the categories table.

3) Have a third table for designs. The designs table would have specific information about the various designs, and also contain a foreign key, linking the table to the IDs of the categories table.

 

You would then need to use joins to combine data for queries. This is, of course, very similar to Larry's second example site in the book, so basing everything off of that and using stored procedures, etc. would probably be beneficial.

 

Anyway, depending on a variety of things, you may need to adjust my overgeneralization, but I think that's a starting point.

 

What do you think?

 

Edit: And like Jonathon said, you'd have to assign the proper values to each of the check boxes by making the appropriate query on page load, and setting the appropriate IDs, etc. to the check boxes.

  • Upvote 1
Link to comment
Share on other sites

Well, the printing options work the same way as anything else.

 

If the print options are unique to each item, I suppose you could keep the print option in the items table. Otherwise, make a separate table, and then link to it using foreign keys. That's kinda up to you, I think.

 

I cannot understand your last question though. What do you mean by "Could I not just put the item in the database manually with the design linked to the item"?

  • Upvote 1
Link to comment
Share on other sites

What do you mean by "Could I not just put the item in the database manually with the design linked to the item"?

 

I think what he means, and I may be wrong, is he want's to store all the different print items in one table, the custom designs in another table, and then link them in an 'orders' table with foregin keys.

 

Is this what you were saying Ben?

  • Upvote 1
Link to comment
Share on other sites

Hello HartleySan and Matt,

 

Thank you for posting back to me. Sorry for not posting back sooner.

 

I am sorry as I have not been sure I have been clear enough. Matt has hit the nail on the head. That is correct Matt, that is how I want the database.

 

I think my inexperience has made this harder to explain, I think. All I want to do is be able to add a print item and add a design item for the corresponding print item. I think what Matt has said is correct and will read more on this.

 

If anyone could suggest any ideas or another design I would very grateful.

 

Thank you for helping me out,

 

Ben :)

Link to comment
Share on other sites

Again, it depends on what the print items apply to. Are the print items dependent on the categories or the individual items? Whichever one it is, that's the one you have to place a foreign key to in the print items table.

 

Make sense?

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...