View Full Version : How To Plan?
Jimerson
March 22nd, 2006, 01:59
I am getting ready to start my first php project :hi:
I have a few questions before I begin.
The Biggest issue I have is the database. I do not understand how to properly set it up can anyone share some links?
Thanks again all for sharing your knowlege.
-Jim
:rockin:
Dan
March 22nd, 2006, 03:11
Do you have a control panel?
Normally you go in there and setup the database.
Then you click on phpMyAdmin, and you can add fields.
Normally..
1) There's the name. This is what the attribute is referred to as.
2) There's the type. Generally, you use INT for intergers, VARCHAR for short blobs of text, and BLOB for long blocks of text. The others, like DATE, you'll be able to figure out on your own.
3) Regarding 2, you need to set a character limit on VARCHAR, but not BLOB or INT. VARCHAR can be anywhere from 1-255 characters max.
4) If you have an ID for a value (which should be INT), set it to AUTO_INCREMENT and PRIMARY_KEY. AUTO_INCREMENT automatically adds 1 each time a new row is added. PRIMARY_KEY should be set, but you can read up on why yourself.
From there, just use mysql_connect, mysql_select_db, mysql_query, and mysql_fetch_assoc, and you'll be set.
[Hopefully some of that made sense.]
Jimerson
March 22nd, 2006, 04:45
Perhaps I should have been more specific. I understand how to build the db. I just do not really understand the different variables. And how to correctly and smartly lay the database out.
Thanks again,
Jim
Dan
March 22nd, 2006, 20:26
Well, what sort of variables? There're loads.
If you can give us an example of exactly what you want to do and how you would accomplish it, either I or someone else can critique it..
Jimerson
March 22nd, 2006, 21:54
Ok. I guess the best way to title what I wish to do would be an inventory system.
I will have items, different categories
only users needed will be an admin.
I would like regular users to be able to add items but them not be added until approved by an admin.
Please tell me what other information you may need.
-Thanks so much for your help Dan.
~Jim
Dan
March 23rd, 2006, 00:56
Have a relation for categories, items, users, userlevels, and sessions.
Items will link to categories, and users/userlevers/sessions will go together.
Let the users add items, but they go in with a `status` of 0. Then the admin can set it to 1 (approved), or delete it.
Is that what you're looking for, or?
Jimerson
March 23rd, 2006, 22:18
something like that. sounds good. Some of that goes over my head. But it sounds good :)
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.