Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2002

    Question writing a news script

    I know how to write, read, and display info. from a MySQL database. I want to make a news script to where after say 20 posts the older posts will go into an archive. I could just use someone elses script but I want to do it by hand for learning purposes. How should I go about doing this?
    "The impossibility of conceiving that this grand and wonderous universe with our conscious selves arose through chance, seems to me the chief argument for existence of God; but whether this argument is of real value I have never been able to decide... The safest conclusion seems to be that the whole subject is beyond the scope of man's intellect." - Charles Darwin

  2. #2
    Join Date
    Mar 2002
    Westbury, LI NY

  3. #3
    Join Date
    Oct 2001
    Just add a LIMIT clause to your query.. then in the archive pull em by month or something.

  4. #4
    To pull the newest 20, add "ORDER BY date desc LIMIT 0,20" to the end of your query, where date is your date field for when the news item was added.

    To then get archived posts on a different page, just change the LIMIT accordingly, eg. "LIMIT 20, 20", "LIMIT 40, 20", etc.

Posting Permissions

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