Forum Moderators: open

Message Too Old, No Replies

How to order a database for this?

New to MySQL

         

pulszar

8:47 pm on Oct 5, 2006 (gmt 0)

10+ Year Member



I haven't even begun to figure out how to output data from MySQL tables into xhtml/php pages, but I will figure that out later. What I'm wondering is, given this scenerio, is a database perfect for this?

Say I have 2 products, A & B, and each of those products both have sections for news, articles, reviews, tutorial guides, books, products, and downloads, each of which I will manually enter in daily.

Next, say I wanted a user to come to a site and be able to view information in several formats:

1) All news stories (product A related on top, B on bottom of page), and the same for every other category. They would also (obviously) be in chronological order by product type.

2) All related categories on one page for product A

3) All related categories on one page for product B

Without the use of a database, I would have used individual includes and pieced them all together over several pages to form the layout I need.. but I know databases offer better flexibility. Since I am new to DBs.. I'm wondering if this is easily doable? I have a reasonable understanding of DBs, just never built one before. Would it just be a series of tables inside one large DB? Is this a better option for storing this kind of data (content) as opposed to manually entering it onto xhtml/php pages with daily updates?

Thanks in advance.

physics

10:18 pm on Oct 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It depends. If you plan on only ever having 2 products than maybe hand-editing the pages would be better. But once you start to get more than that yes a database with several tables is the way to go. Also there are advantages to using a backend db that stores the data and pages that present it ... it gives you a new level of abstraction and changing one thing in your program can be reflected on all your product, review pages, etc. But you can get that to some degree with includes to so you have to decide what will be better for you, spend your time learning to design and implement a db and program or hand editing the pages. If learning new things and expanding your knowledge is part of what you want to accomplish I'd say go ahead and try to write a db/program but if you just want to get these 2 products up quickly do it by hand.

pulszar

1:28 pm on Oct 11, 2006 (gmt 0)

10+ Year Member



Thanks for the advice. I would really like to go the db route just because I've always wanted to learn how to integrate db into webpages, so long as its the most efficient method.

One use for the db would be the example I gave, the other would be for managing the content. As I said before, the core of the site will be made up of review/news/article/tutorial pages, so for every new story, article, etc, I would just add to the database. I guess it would be pretty simple in design as it would only need fields for a headline, date, url, story caption, etc. Again, I mainly just care about efficiency and easy of maintanence.

physics

3:45 am on Oct 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should check out phpMyAdmin. You may be able to get away with not having to write a backend db admin script. If you keep the db simple you can just edit it from phpMyAdmin.
The code to pull the data out of the db actually isn't too complicated, just look around for PHP MySQL tutorial/example etc.