SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Store articles in DB or not?

    Hi all,

    let's take SitePoint's articles as an example. Is it wise to store the entire text in a database or might it be more elegant to put into a textfile on the server and let it parse the header, footer etc. What do you think and what does SitePoint do?

    Currently I'm having everything a the DB but it's not very comfortable to manage it, especially when the text is multi-paged...

    Thanks for advice!

  2. #2
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm personally for the db solution. The sites in my sig use a db for every single page - making archiving, randomizing, searching etc an absolute breeze.
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  3. #3
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would second H.

    Dekuro: Would you please tell me how were you able to have multi-paged articles? I would like to have that too!



    -Omair
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  4. #4
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Omair: I write down [PAGEBREAK] into the article and viola the text is splitted Here's the code:

    PHP Code:
    $numpages count(split("[PAGEBREAK]",$fulltext));
    $pagetext split("[PAGEBREAK]",$fulltext);

    ... 
    The rest is a little tricky and different from case to case, which concerns the page navigation. I've seen many posts here already that discuss such topics.

  5. #5
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think SitePoint uses an xml backend for the article script

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  6. #6
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XML Backend ? How?? How can XML be used as a backend??
    Sean, now you have left me with a new question which won't let me rest until I know something about XML.



    -Omair
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XML?? Did that just change? I always assumed they stored articles in the db.


    There are a few tools out there that can generate xml files from a mysql database, thats probably what Sean is alluding to.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  8. #8
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would anyone from Admin@SP like to clear the thing out??

    I am just getting curious.


    -Omair
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  9. #9
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure I have read that XML is used

    This is a very simple example of how you can store XML data Omair:

    Code:
      <article>
        <date>15 October 2001</date>
        <title>BlahBlahBlah</title>
        <author>SoitePoint Master</author>
      </article>
    Then when you add an article you just add another <article> section to the XML file

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  10. #10
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sean,

    I am afraid to say that you are a bit wrong..

    This is what Kevin Yank told me:

    The 'live' version of SitePoint site still runs on our old MySQL database with custom tagged content (not XML). We are working on a new version of SitePoint that uses PostgreSQL, and we have yet to determine how much (if any) of the document data will be in XML.
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  11. #11
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh well, not the first time

    But it is possible to store articles in XML format and it is very fast

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  12. #12
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well we need an XML parser, don't we

  13. #13
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, it is called domxml and is a standard PHP extension

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •