I'd like to import into my MySQL database some text files (like news, etc.). Which is the best way to format the chart?
Those file are text file (.txt) with news content. Then I post those files on my homepage. The first line of the original text file is the title, other lines are the text.
Which is the best way to extract those file and post them properly? Should I create 2 coloumn, post the title (first class) on the first coloumn and the rest of text on the second coloumn?
Yes create a MySQL table called "news" with fields
id
(int, auto increment),title
(varchar 255) andbody
(mediumtext).Then use
file
to get an array of lines in the text file, and insert into the table withtitle
being the first element in the array and the rest inbody
.