View Single Post
  #2 (permalink)  
Old 04-03-2007, 03:56 PM
melkior_inactive
Guest
 
Posts: n/a
Default

Well, the best way to design the DB is to get all the data you will be using on a paper.
When I create web apps, the first thing I do is design the database. I find it easier to develop the application when I have a data overview. Then I know what functions I'll need and what parts the app will have.
I lay out all the data I'll be using and manipulating and try to organise it in tables the best way I can. I sometimes draw dataflows and workflows to get the a better view of what I'm actually doing.
Basic structure would be users table, products table, other tables.
I like keeping the settings in files, not in the database.
So if I want the images for products, I'd add a column in the products table and name it images, or something.
To store images, you use BLOB.
It's a datatype - Binary Large Object.
Now, it's usually recommended not to store images in the DB, but I'm running a site that had 13GB (not a mistake, it's gigabytes) of pics stored in BLOBs so you shouldn't have any problems.
If you need more help, post more specific questions and I'll see what I can do.
If you want to avoid storing images in the DB, you could upload them to a folder, and store the path to the pics in the DB instead.
Reply With Quote