In Database - to HTML

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Dr. PHP
Forum Newbie
Posts: 11
Joined: Sun Nov 24, 2002 8:46 am

In Database - to HTML

Post by Dr. PHP »

Here's a question...I'm storing news stories in a MySQL database. These stories are searchable by date, subject, category, keywords, etc. Well we are adding an option to send the article via e-mail to yourself or a friend. The company wants to be able to send an HTML link instead of just having the story in the e-mail.

Everytime a new story enters the database, should we just go ahead and produce it to a txt HTML file as well and call it "UniqueID.html". Otherwise, the server would just get cluttered with pages from old old searches. Would it still be better to generate them on the fly instead of creating an HTML page for every article at the time they enter the database?
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I'm not sure exactally what your asking but this is what i do for articles:

I use the switch() function that switches between the variable $article, and the case's are the article IDs from the database. The multiple case rows will be called by the while() loop from the database.

This saves alot of web space for pages. It's just a simple page like:

http://www.yoursite.com/articles/?article=974

Hope i helped! :P
Post Reply