Results 1 to 4 of 4
Thread: writing a news script
-
10-10-2002, 10:36 PM #1Aspiring Evangelist
- Join Date
- Mar 2002
- Posts
- 376
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
-
10-10-2002, 10:44 PM #2Web Hosting Master
- Join Date
- Mar 2002
- Location
- Westbury, LI NY
- Posts
- 1,705
The manual helps:
http://www.mysql.com/documentation/mysql/full/
Or you can try some tutorials to get you started:
http://hotwired.lycos.com/webmonkey/...tutorial4.html
http://www.devshed.com/Server_Side/M...tro/page1.html
http://www.sqlcourse.com/
http://php.weblogs.com/adodb_tutorial
-
10-10-2002, 11:44 PM #3Junior Guru
- Join Date
- Oct 2001
- Posts
- 179
Just add a LIMIT clause to your query.. then in the archive pull em by month or something.
-
10-11-2002, 11:57 AM #4Junior Guru Wannabe
- Join Date
- Mar 2001
- Posts
- 33
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.