|
Users viewing this topic:
none
|
|
Login | |
|
Database Question - 9/3/2008 6:20:42 AM
|
|
|
FreeEagle
Posts: 44
Joined: 7/2/2008
From: Minnesota
Status: offline
|
I'm still in the pre-planing stage, and am somewhat lost - but I'm building my first database using MySQL. Lets say I want my database to list books available at different book stores around the country. So I would have a categories for the book classification, the title, a brief description, and the name and address of the book store. Now some of these books I'm going to add to the database myself, and others the book store owners will add. Question 1.) I want ALL my viewers to see the book classification, the title, the description of the book, and the city in which the book is located, but I only want SELECT PEOPLE to see the actual book stores contact information. Do I need one database to list the books, and another database to list the stores contact information? How do I separate what information some can access? Question 2.) How do I Design a form (I'm somewhat familiar with html forms) that will allow my viewers to enter their own information into the database? Currently I have my forms go through cgi-bin, and the information comes to me in an email. Can I redirect this information directly into the database?
_____________________________
I will instruct you and teach you in the way you should go; I will counsel you and watch over you. Do not be like the horse and the mule, which have no understanding but must be controlled by bit and bridle or they will not come to you. Psalms 32 8-
|
|
|
|
RE: Database Question - 9/3/2008 2:01:01 PM
|
|
|
PolarBear
Posts: 558
Joined: 4/11/2005
From: Moving to San Antonio!
Status: offline
|
Hi, No, use the same database for everything, especially if it will be joined together. Use different tables though. Always remember the principle of normalization. If you don't, you will regret it later. It basically means that the same piece of data should never be stored twice. For example, do NOT have a table like this: book name, book store name Instead have a table 'books' with a field 'id' (type auto_increment) and the title and description as text. Another table 'bookstores' also with an auto_increment id, bookstore name, address, whatever as text. Then a table 'bookatstore' or whatever with each row containing the ID of a book and the ID of a store. About forms, that's the fun of web programming. It can be a bit tedious. Basically your server script has to parse the contents of the form variables, then construct an appropriate SQL database command inserting all the values. If the form is for editing a record, it first needs to SELECT the current contents, put them in the form, then on submit you need to construct an UPDATE command.
_____________________________
My current ministry dream: http://victorymuseum.org
|
|
|
|
RE: Database Question - 9/3/2008 9:10:41 PM
|
|
|
iluvatar
Posts: 2028
Joined: 4/12/2005
Status: offline
|
Are you doing this as homework or are you doing this as a business? I won't say that there's a TON to understand about doing basic database design, but there's enough that you shouldn't be starting on something that's eventually supposed to go into production. Even a semester or two of undergraduate database theory that includes normalization and SQL basics would help immensely. -Dan.
_____________________________
Well, I've been to one world fair, a picnic, and a rodeo, and that's the stupidest thing I ever heard come over a set of earphones.
|
|
|
|
RE: Database Question - 9/7/2008 8:37:55 PM
|
|
|
FreeEagle
Posts: 44
Joined: 7/2/2008
From: Minnesota
Status: offline
|
Thanks all for the tips, I understand a good portion, but as much as I hate to admit it I think I'm going have to go to classes. I just think of the last learning seminar I went to, Paid $6,000 - I learned a lot, but after I understood the terminology, I found out I could have learned the same thing for $40 on the web. Is there any good recommended books on database building, like that show pictures of "if you want this" do this? I think now I'm clear as to 80% of what I have to do to build the database, but I'm still lost as to building pages where "XYZ" is the information, a viewer only sees "Y" or ads information to only "X and Z"
_____________________________
I will instruct you and teach you in the way you should go; I will counsel you and watch over you. Do not be like the horse and the mule, which have no understanding but must be controlled by bit and bridle or they will not come to you. Psalms 32 8-
|
|
|
|
RE: Database Question - 9/7/2008 9:25:06 PM
|
|
|
iluvatar
Posts: 2028
Joined: 4/12/2005
Status: offline
|
quote:
ORIGINAL: FreeEagle Paid $6,000 - I learned a lot, but after I understood the terminology, I found out I could have learned the same thing for $40 on the web. YIKES! One or two classes at a community college ought to be enough to get by for small databases. quote:
but I'm still lost as to building pages where "XYZ" is the information, a viewer only sees "Y" or ads information to only "X and Z" SQL is used to send a variety of commands to a database including fetching data, creating new records, searching, etc. The specifics of how to implement that into your web site are dependent upon how exactly your site is configured. -Dan.
_____________________________
Well, I've been to one world fair, a picnic, and a rodeo, and that's the stupidest thing I ever heard come over a set of earphones.
|
|
|
|
RE: Database Question - 9/7/2008 9:33:32 PM
|
|
|
LoyalGypsy
Posts: 2495
Joined: 4/12/2005
Status: offline
|
quote:
ORIGINAL: FreeEagle Thanks all for the tips, I understand a good portion, but as much as I hate to admit it I think I'm going have to go to classes. I just think of the last learning seminar I went to, Paid $6,000 - I learned a lot, but after I understood the terminology, I found out I could have learned the same thing for $40 on the web. Is there any good recommended books on database building, like that show pictures of "if you want this" do this? I think now I'm clear as to 80% of what I have to do to build the database, but I'm still lost as to building pages where "XYZ" is the information, a viewer only sees "Y" or ads information to only "X and Z" Greetings Check this site out, it offers a little about Advanced Access ...free! http://iso.hsc.wvu.edu/cblc/HowTo/HowTo.php LG
_____________________________
Ex 19:5 Now therefore, if you will indeed obey My voice ...So the Persians ask that the 300 drop their arms. Leonidas responds; "Persians! Come and get them!" 300 The Movie
|
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|