SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Site database

  1. #1
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, Yesterday i started MySQL and PHP, did the joke things that was in the articles:

    http://www.webmasterbase.com/article.php3?aid=228&pid=0

    My Question is how would i go about designing a site like sitepoint. Database wise.

    A Table layout would really help then i can get started.

    I know that allot of you have done such things : eg, webdevhq.com just one example ut there are allot more.

    One more thing puzzels me: If an article is multi-paged, then does the writer have to write the link to the next page or should PHP automatically insert the relevant page?

    Peter

  2. #2
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In a sysem like SP PHP generates the links to each page of the article.

    Table wise a CMS would be similar to the joke system (I haven't looked in detail at it), but instead of storing a joke it would store a page or a paragraph (As SP does).

    It's a case of trial and error and reading up on good database design and normalisation - unfortunatly I don't have any resources to point you to but if you to a search for normalisation you will find something in these forums as I know it has been posted before.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  3. #3
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How would you make PHP automatically add links?

  4. #4
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simply check for the existance of a further page, if it exists, pull its title and pid and add a link to it.

    Not that difficult.

    As for your original question.

    A table could be set up with these fields:

    Category
    Subcategory
    Date_Added
    Status(active, hidden, featured)
    Title(overall title)
    Subtitle(title for this specific page)
    AID(article ID)
    PID(page ID)
    Author
    Text

    And so on. Obviously you could get rid of the sub cat field if you wont use subcategories. Just something like that should work.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  5. #5
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx allot,

    Would it be a good i dea the change author to aid,

    then i could have authors email, description, etc

  6. #6
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya sure, have an AID instead and then join it to a table with author information.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •