Database design help.

liunx

Guest
OK, here's the situation:

I want to be able to post news and blogs...news items on two seperate pages. But I want the headlines of those entries to be on the same list. How can I accomplish this? To better clarify:

2 seperate pages, my front news page and my blog...like this:


----------------- /// ----------------
| News Item | /// | Blog Item |
----------------- /// ----------------
| news news news | /// | blog blog blog |
| news news news | /// | blog blog blog |
| news news news | /// | blog blog blog |
| news news news | /// | blog blog blog |
| news news news | /// | blog blog blog |
| news news news | /// | blog blog blog |
| news news news | /// | blog blog blog |
| news news news | /// | blog blog blog |
| news news news | /// | blog blog blog |
----------------- /// ----------------


and then the headlines on every page like this:


---------------
Blog item
News item
News item
Blog item
etc
---------------



All in one part. So how do i set up the databases? A database for the whole thing, then a table for the news items, another table for the blog items, and a last table for the headlines. When I write the CMS, I'll have the headlines get inserted into one table, and the news item posted to the correct table. Would that work? Thx.I'm guessing by the lack of responses that I'm not the only one who is slightly confused by the post.

So, let me try to crack this thing out a bit.

You have two different types of entries: news and blogs (whateva the heck that is)

Each entry type contain the same type of content (large amount of text) except the blog is two pages long.

This is where it gets confusing, what exactly are you wanting to know as far as your database goes.

If you just need a technique to discern blogs from news then you could design a table with these columns:
1. Content
2. Type
3. Heading

You put the guts of the articles in the content column, the hading in the heading and then like a 1 or a 2 for the type (if you're gonna have a field that is gonna be the same things over and over again - in this case: news or blogs - try to use integers on your main table so that your searches are quicker - then, if you like you can have a separate table to keep track of what the integer types relate to.

So, if I got ya right, just have two tables:
#1 for the content, like I just showed
#2 to store type values:
this table would look something like this

ID | Value
1 | News
2 | Blogs

Might be way off here, but hope it helps somewhat.
 
Top