PDA

View Full Version : Newbie/database design questions


Klotzkupf
4-16-05, 01:22 PM
New to the forum, my first post. I've developed a web site using MySQL and PHP/HTML (see: http://www.ufopop.org) and I have a couple of questions that I just don't see covered in the documentation.

I have several types of content each of which will require a separate table with different field stuctures. All content will be images and accompanying text. Each content type will consist of no more than a couple thousand records at most.

If you look at the comics section of UFOPOP, you can see I have it working (needs some refinement I admit)

Here's the question: Can I have 6 or 7 different tables with different field structures each containing up to 2000 records in the same database, or should I create a different database for each content type? - or can I even create that many databases?

I think I have somewhat of a handle on how to create, populate and access tables, but this basic design issue has me wondering.

Thanks in advance for your input.

- Klotzkupf

RTH10260
4-16-05, 02:35 PM
Here's the question: Can I have 6 or 7 different tables with different field structures each containing up to 2000 records in the same database,You can have as many tables in a database as your application needs. Any table can hold as many rows of data as you need. Any technical limit is far out of your reach (some large enterprises may get to see a limit once in a while). To be precise, your limit is your 2GB storage of your account.

Hint: Don't store images themselves in the database (as BLOBs), keep them in the filesystem and only store a relative directory structure / file names in the database. or should I create a different database for each content type? - or can I even create that many databases? NO ! Apart that you only have five databases coming with your account, and any extra will cost you a one time fee, a 'MySql database' is intended to hold the content of one application.

Klotzkupf
4-16-05, 04:37 PM
Thanks for your quick reply. I guess my concern is that while some of the tables will have similar fields, all will have some different fields. I figured the database record limit would not be a problem, but I guess I'm thinking in old flat database terms.

So I gather there is no problem in duplicating field names in dfferent tables? Or should I keep them unique?

Thanks again,
Klotzkupf (Jim)

mitchind
4-16-05, 04:57 PM
So I gather there is no problem in duplicating field names in dfferent tables? Or should I keep them unique?


You're correct - you can have identical fields names in different tables. Tables have to have unique names within a database.

Klotzkupf
4-20-05, 01:40 AM
Thanks for your reply.

DrewGreen
4-20-05, 04:38 PM
Read up on relational database design. It will help you decide how to structure your db & tables in a much more useful way. This is a good start - http://www.edm2.com/0612/msql7.html