Results 1 to 3 of 3
June 17th, 2005, 12:08 PM #1Storing articles in MySQL
What is the best way to store articles in a MySQL database?
I want to be able to store small (2 or 3 paragraph) articles in a database and use it as content for a content site. I am already doing this to a degree. The problem is that the source text files have hidden characters for carriage returns, tabs, and line feeds. In a PHP script I can pull an article but it is not really formatted nicely because of the hidden characters that were transferred from the text file to the database. Am I making sense??
How to get the text formatted properly and make sure my MySQL database is also setup properly?
June 17th, 2005, 06:53 PM #2
You should be able to use str_replace() to find the \n new lines and \t tabs in the text and replace them with whatever you want.But are you still master of your domain?
June 23rd, 2005, 01:19 PM #3
- Join Date
- June 9th, 2005
Try the nl2br() function.
By TechMan in forum Commission Junction - CJReplies: 6Last Post: November 13th, 2010, 12:53 PM
By bsnrjones in forum Programming / Datafeeds / ToolsReplies: 7Last Post: March 5th, 2004, 01:47 PM
By Dirk in forum Midnight Cafe'Replies: 4Last Post: February 21st, 2004, 05:44 PM
By Pete in forum Programming / Datafeeds / ToolsReplies: 1Last Post: April 29th, 2002, 02:44 AM