Jump to content

database questions


kcotter

Recommended Posts

Hello,  I'm fairly new to PHP, and I'm looking to create an online catalog for a furniture/appliance store.  I'm wondering the best way to go about this.  I'm looking at SQLMaestro's "PHP Generator for MySQL" http://www.sqlmaestro.com/products/mysql/phpgenerator/ ... But, I'm curious if you guys can point me in the right direction.  I've never created a database before, and I want to do it the way that makes the most sense...  Any advice would be appreciated!!

 

Link to comment
Share on other sites

Find some tutorials. I've only learnt PHP myself in the last couple of months by watching youtube videos, and now I'm very confident working with it. Just read what you can. It's better to learn how to code that to use a GUI (which is what I think the SQLMaestro thing is), as it will allow you to better understand what you're writing, and also make it more efficient.

 

Other than that, I'd suggest paying someone :).

 

Denno

Link to comment
Share on other sites

Paying someone would be great, but I don't think I have the budget.  Not sure how hard it would be for someone to set up my database so I could just add the furniture and stuff...  I guess that could be easy for the right person.  But, I'm sure there's more to it than I'm aware of.

Link to comment
Share on other sites

It really isn't that hard at all.

 

The best way for you to do it is to sit down with a pen and paper, and work out what bits of information you need for each item. This will be how many columns your products table has. Add one for id, which is completely necessary, and which you will also make the primary key (unique identifier). Once you have your tables worked out on paper, you can translate that into a database. I would highly suggest using phpMyAdmin. It will make everything soooo much easier.Go to youtube and see what you can find on how to create tables using phpMyAdmin.

I promise you it isn't as scary as you're thinking it is.

 

Denno

Link to comment
Share on other sites

thanks a lot for the help!!!  I'm going to for sure look into phpMyAdmin.  I'm at work now, and youtube (along with most other stuff) is blocked... I do know that I'll be using GoDaddy.  And I'm pretty sure you can log on and create a database thru the godaddy interface, but maybe I don't need to do it that way if I use phpMyAdmin...  For some reason I'm picture a database as a file that you can create.  Then you just upload it to your mysql folder on your server...  Am I even thinking the right way?  Does phpMyAdmin help create the file (database)?  Sorry for the stupid questions..  But, you're helping me a ton! 

Link to comment
Share on other sites

ok, so I created my database with GoDaddy... I'm not really sure on how to set it up, so maybe you guys can help me, or get me going in the right direction....  I'm making a product catalog for a rent to own store.  There will be no "cart" just a catalog that shows the price, title, and short description of each product.  Also, a photo.  Anyway, I have 4 main categories... Appliances, Computers, Electronics and Furniture.  Now I'm getting confused because under Appliances (for example) there are 3 categories... Kitchen, Laundry and Other.  Also under Kitchen (for example) there are 5 categories... Freezers, Microwaves, etc.... and under each of those categories are the actual products.  For example, an Acme Freezer would be listed under Appliances>Kitchen>Freezers>....  So, my first issue is, I created a database, and I need to create a tables.. Do I start off with 4 tables (Appliances, Computers, Electronics and Furniture)?  Or should I just make one table and call it Products and put every product in it?  The only tutorials I can find are teaching me how to make a member log in and stuff...  any help would be cool.

Link to comment
Share on other sites

Hi kcotter, i don't think you will end up having something that works as good as you want if you have complety no idea about the logic of a relational database. If you like i can look up some videos for you and link it, it's a complete lecture on how to setup a good database structure. Right now you will just make tables not knowing what it will bring in the end.

 

 

-Edit:  here you are, after you have seen these, get a pen and pencil and write down the relationships:

Link to comment
Share on other sites

Yeah, I just started researching this tonight.  If you have time to post up some links that would be cool.  Over the next few days/weeks I plan on getting a crash course in mysql.  I'm pretty green right now, but I know way more than I did 6 hours ago.  thanks for the reply!

Link to comment
Share on other sites

Yeah, I just started researching this tonight.  If you have time to post up some links that would be cool.  Over the next few days/weeks I plan on getting a crash course in mysql.  I'm pretty green right now, but I know way more than I did 6 hours ago.  thanks for the reply!

 

That's the best i can give, just use pen and pencil and watch it as if it were a lecture, footagee is a bit oldschool, but the ideas are still the same

Link to comment
Share on other sites

Ok, so I was thinking about this again this morning.  Please let me know if I'm way off base, but I'm thinking I should create 1 table, and call it all_products or something... and have the following fields or columns:

 

id

category1

category2

category3

title

description

avail_colors

price

image_name (not sure if this is possible or not, but each product would have an image in an "image" directory)

 

Then I can create a php form where I can enter the info into text boxes that submit to these fields... at least this is the direction I'm thinking...  does this seem like a good plan of attack?

Link to comment
Share on other sites

You do not create a database with phpMyAdmin.

 

Most every host that allows databases use the cPanel software, which allows you to set up email, files, logs, security, domains, security, databases and a couple of others.

 

Database setup and maintenance is done with MySQL. Table setup and maintenance is done with phpMyAdmin, tho to set up a site you will have to learn php.

 

Before you do anything, I would strongly suggest you study and have a good understanding of a relational database. Then design on paper every field that you want to use and how it relates to another field/s. Now do a flowchart of the programs you will need to access/add/change/delete/display the data. Otherwise you will waste many, many hours and end up with a mess which you will have to redo.

 

 

Link to comment
Share on other sites

I was in the furniture mfg business for many years and will give you a couple of examples of what I was talking about.

 

partno file - a unique part number for every product

 

If you offer more than one color for a part number you cannot put colors in that file. You must cross reference and link from the partno file to a colorno file. Same for any other attribute that offers options.

 

Price. If you offer different prices to different customers then you must design your database to reflect that option. Discounts?

 

It can get pretty complicated and must be thought out.

 

 

Link to comment
Share on other sites

Those are good points.  Just so we're on the same page, I'm basically recreating a site just like this: http://www.continentalrto.com/  The color field would probably not be "avail_colors"  it should just be "color" .  If they have a black couch, they don't offer it in brown also...  My mistake.  But I thought I should have a field named "color" just so you could search the database for every black piece of furniture for example...  Every product is individual, and the only relation it would have to other products is the category it's in.  This seems like it shouldn't be that hard.  I can't believe I can't find a tutorial to set up exactly what I'm talking about.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.