Hello all,
Am trying to create my first database/php site and having a little trouble. I will admit I am a beginner, so, I'm sure that a lot of what I'm trying to do is probably over my head, but, have a project to be done, and we were all beginners at some point in time.
Basically what I'm doing is trying to create a database that has some items in it and what they've sold for. I'm trying to make it search able by year, manufacturer, set, and player. I've already determined that I need the following tables:
Manufacturer
Set
Subset
Player
Sales
Item
And that I can/should link them together as such Manufacturer-Item-Sale Item-Subset-Set Item-Player
However, I'm having trouble grasping entering in all the data as for set 1 there could be 15 items of player 1. Is there any way to automate the tying together, in that if I have Joe Blow (ID 1) I don't have to type in 1 every time? Or that I could upload Item data and have it connect backwards to the proper Set, etc.?
I also have determined that I need to create a separate table for log ins for the site? I also want to handle subscription services, so I'm guessing that purchasing the script for a system would probably be best here.
Thanks for any questions/comments/ideas/help.
Trying to Create First Database
Moderator: General Moderators
- akuji36
- Forum Contributor
- Posts: 190
- Joined: Tue Oct 14, 2008 9:53 am
- Location: Hartford, Connecticut
Re: Trying to Create First Database
Take a look at this video tutorial for php and mysql. It will
give you a better understanding of how it works--I've
always preferred video than words. I think you can
quickly learn how to develop your own script in a short while.
link is here see lessons 13 and 14 under old videos:
http://www.phpvideotutorials.com/free
give you a better understanding of how it works--I've
always preferred video than words. I think you can
quickly learn how to develop your own script in a short while.
link is here see lessons 13 and 14 under old videos:
http://www.phpvideotutorials.com/free
Re: Trying to Create First Database
In general, you should understand that you have a substantial learning process to undergo. Don't be intimidated, we've all been through it and I'm sure you can do it, too, but don't underestimate the amount of learning. My advice is to start with basics before you attempt as complex a project as you described. In other words, create a much simpler database as your first database. You can discard it a week later, if you feel comfortable working with the simple one, but if your very first database is complicated, you will be distracted by the many issues that arise, making it much harder to learn the basics.
You can do all the things that you mentioned you want to do. It's done in nearly every database. But there are as many ways to do it as there are database developers. Some of it will require you to t-h-i-n-k about precisely what you want it to do.
The way to determine what tables you need is to carefully identify what entities will be represented in your database. Each entity must have its own table, and you will need an additional table wherever you have a many-to-many relationship between 2 entities. That, and that alone, determines what tables you will need.
I recommend that you start by turning off your computer and grabbing a pencil (with an eraser) and a sheet of paper. On that paper, see if you can write a very brief description of the entities you want to represent. Something like this:
Once you have what you consider clear and concise entity descriptions, you can decide what attributes of each entity you want to store. These, of course, are the columns (or fields) in the tables.
Finally, for any many-to-many relationships that you may have, you will need an "intermediate" or "linking" table.
So then you can create the database and the tables in the database.
You will probably need data entry and editing forms for each table, other than the intermediate tables. Those will be populated by your PHP logic when your application defines related items.
Again, in my opinion, your description of the project makes it unsuitable for anyone to attempt as their very first database.
You can do all the things that you mentioned you want to do. It's done in nearly every database. But there are as many ways to do it as there are database developers. Some of it will require you to t-h-i-n-k about precisely what you want it to do.
The way to determine what tables you need is to carefully identify what entities will be represented in your database. Each entity must have its own table, and you will need an additional table wherever you have a many-to-many relationship between 2 entities. That, and that alone, determines what tables you will need.
I recommend that you start by turning off your computer and grabbing a pencil (with an eraser) and a sheet of paper. On that paper, see if you can write a very brief description of the entities you want to represent. Something like this:
Each entity will require a table. If you have trouble writing these descriptions, you're not yet ready to design your database.Manufacturer: the mfr name (and address?) of each item. the same mfr may provide more than one item.
Item: (since I don't know what these are, I can't write an example)
Player: (same thing)
... etc.
Once you have what you consider clear and concise entity descriptions, you can decide what attributes of each entity you want to store. These, of course, are the columns (or fields) in the tables.
Finally, for any many-to-many relationships that you may have, you will need an "intermediate" or "linking" table.
So then you can create the database and the tables in the database.
You will probably need data entry and editing forms for each table, other than the intermediate tables. Those will be populated by your PHP logic when your application defines related items.
Again, in my opinion, your description of the project makes it unsuitable for anyone to attempt as their very first database.
-
DaiLaughing
- Forum Commoner
- Posts: 76
- Joined: Thu Jul 16, 2009 8:03 am
Re: Trying to Create First Database
I agree with califdon this is not a good project for a first attempt. Consider working through a tutorial or even better a good book (the Wiley PHP5 and MySQL bible is a good if heavy one) as well as those videos. It will take weeks or months. There is a reason that database people are always in demand.