Reply
Noobie questions, need a basic database help.
Old 01-12-2006, 02:45 AM Noobie questions, need a basic database help.
Average Talker

Posts: 25
Hello all, Im a noob and this is my first post,

I need a lot of help with my database. Right now I have a static html website with too many products to maintain. My goal is to make a site like www.sjgreatdeals.com. They have 1000'sss of products and i know they are not just static html pages. My site is www.topbuy1.com and it's no where near as big. I've been reading alot about databases, which is extremly new to me, all i know is html. I heard that using php and mysql would be the way to go if i wanted to make a massive E-catalog like www.sjgreatdeals.com. Is this correct? If not, what should I use instead of php and mysql that doesnt cost $1000s of dollars?

I have a small test page running right now somewhere else just to practice with mysql and php (by the way, the MySQL is run on a dedicated server from my webhost at dreamhost.com and it uses PHPmyAdmin as the management system).

I created a small database with 4 rows and 4 collums with information like "id" "modelnumber" "description" "price" with 4 rows of values. Basically its 4 products. Now how could i make 4 product pages out of that??? what kind of code would i have to use to do this or what would be the least time consuming way of doing this be? About all I've done on the practice site was connect to the database and was able to display the first row of information over and over again and thats about all i can do. Please post the exact code so I can see whats going on.

Also, www.sjgreatdeals.comproducts are all in .html files, and i know its not a static website, its just too big and would take forever to check the distributor inventory and price changes daily. Does anyone know what this is or how to make a php page and mask it as html page?

MOST IMPORTANTLY, from your own experience, what is the best basic design or database structure (i was thinking like an MSExcel list or lists type thing) you would use to create a huge site like www.sjgreatdeals.com or a massive e-catalog? I need some type of direction to do this. Please post in babywords step by step, I'm just learning the stuff.

Thank you very much, Ryan
wickland is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 01-12-2006, 06:01 AM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Other than PHP/MySQL, you can also use Microsoft's ASP.NET with SQL Server. Thats what I use to run www.inoxia.co.uk. It's easy to learn, very structured and all in all a great framework. Plus you can pick what language you use. You can find out more at www.asp.net - there's loads of tutorials there to get you started reading data from databases and displaying it in datagrids (basically dynamic tables) etc.

I would imagine the reason the site you mentioned looks as though it is using static HTML files is that it is using some sort of URL re-writing. By using URL re-writing you can hide your internal logic from the outside world. This makes it easier for users (the URL looks neater and easier to remember) and helps with search engines. Both PHP and ASP.NET support URL re-writing. An example would be:
Old URL: http://www.yoursite.com/products.aspx?ProductID=34
Rewritten URL: http://www.yoursite.com/products/34.html
(but it can get more complex than that)

As for DB design, basically you want a table for each logical seperation of your data. For example, you might have Products, Categories and Manufacturers. So you would have 3 tables names as such. Your columns for Products could be something like:
Unique ID, Product Title, Category ID, Manufacturer ID, Product Description, Cost
Manufacturers might be:
Unique ID, Manufacturer Name, Telephone No, Address
and categories:
Unique ID, Category Name, Category Description

Notice I've given each table a unique ID. Persoanlly, I give every table I make a unique ID (but you don't have to). You use this ID to link the tables. So instead of writing out the category name 50 times for 50 products in the category, you just write the ID. That way, if the category name changes, you don't have to change it 50 times in the DB. Also, it saves memory in the DB and makes it easy to pull from the database just a list of categories. The same logic applied to Manufacturers.
It can get more complicated than this. www.inoxia.co.uk has 4 tables for the catalogue alone - Sections (Mesh, Chemicals, Misc, Tools), sub categories, product details, and products. (because we sell the same product usually in 2 or 3 different weights or sizes).

That should get you started. There's loads of tutorials on ASP.NET and PHP online, and if you get stuck post back here.

- Mina
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"
Inoxia Pyrotechnics Supplies | Surrey Angels Cheerleading Squad

Last edited by Minaki : 01-12-2006 at 06:03 AM.
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 01-30-2006, 08:31 AM
hiptobesquare's Avatar
Extreme Talker

Posts: 173
Location: London UK
Ive just spent the last year doing exactly what your doing - writing a shopping cart system for my online wardrobe company. I used PHP so cant tell you anything about ASP scripting as Minaki can. Keep in mind the you are dealing with 2 seperate scrpiting languages here. MYSQL and PHP or ASP. Mysql queries in themselves are very simple and will generally read like english, but in order for them to be understood by a server you need to combine them with php. Here is a simple Mysql query:

SELECT * FROM PRODUCTS

As it says, this query will select all (* means all) from a table named products. You couldn't write this into a script and expect not to get an error, so youl need to learn a bit of php or asp.

You said start from the ground so i will - PHP is a server side scripting language which works basically by using variables. A variable can be pretty much anything you want (string of text, number, word).
You will know a variable is a variable because it will always begin with $. Say i wanted to create a variable called $var1, id do this:

$var1='value of your choice';

Now any time you write $var1 one in a php script the browser will read back 'value of your choice'. This is how you make a server understand mysql queries, you turn the query itself into a variable:

$query="SELECT * FROM products WHERE id = '$id'";

your browser now holds everything from the products table where the id column is whatever value you assigned to $id variable. All you got to do now is figure out how to retreive this info from your browser, il leave you to do that.
Bear in mind that a browser wont understand an html page containing php unless you tell it to like this:
<?PHP
php code here
?>
You can find a very good local server here www.xampp.org
(creates a server on your c: so you can run php and mysql from your puter without connecting to anything.

Good Luck

Last edited by hiptobesquare : 01-30-2006 at 08:33 AM.
hiptobesquare is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Noobie questions, need a basic database help.
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14400 seconds with 12 queries