Welcome to WebmasterWorld Guest from 3.234.210.89

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Simple file format for selecting paragraghs of text

Please suggest a simple

     
12:44 am on Jul 17, 2003 (gmt 0)

New User

10+ Year Member

joined:July 1, 2003
posts:39
votes: 0


Folks,

I wonder if someone might be able to suggest which method of extracting one of a number of paragraphs of text (perhaps with some HTML style tags included) would be best for me? I am generating a dynamic HTML page (describing items of music) which has a synopsys paragraph followed by some shorter items of data presented in tabular form (multiple recording dates and available CDs, and the orchestration, etc).

I'm storing the short tabular data in a MySQL database along with my menu system, etc.

Should I put the paragraphs in a separate text file - with identifiable start/end delimiters - and parse the file (each time the webpage PHP is executed) into an array ($title => $paragraph)? A separate text file for each paragraph seems messy, hard to manage. As a relative newcomer to PHP I'm not sure of all the options open to me for simply and quickly parsing a file to return one of many paragraphs.

Ah, a thought just occurred to me. Perhaps I should write a script that generates the MySQL table by parsing a text file, thus allowing me to use an appropriate editor to manage the source text file. Then my website PHP can simply run entirely on the MySQL. Any limitations on the content and length of a varchar table element?

Any suggestions would be much appreciated. What's fastest and simplest? MySQl, or parsing text files?

Michael

4:18 am on July 17, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 8, 2002
posts:65
votes: 0


I'd say go all MySQL and use "text" fields, not varchars. It doesn't sound like it will inflate your database much. =)

And it will become easy to handle - to back up, search - and just easier to look after.

Have a search through the mysql docs on mysql dot com about text and blob fields (one is case sensitive).

12:04 pm on July 17, 2003 (gmt 0)

New User

10+ Year Member

joined:July 1, 2003
posts:39
votes: 0


Thanks very much. I'll have a look at that...

... well I would if the MySQL documentation was any good. It's appalling. I downloaded the .hlp and .chm versions, and I hate them both. The Windows .hlp system is ugly to start with so I'm not using that, and I'm very disappointed with the .chm version.

The PHP documentation is top-notch - a thorough index and separate pages for every function, etc.

The MySQL documentation, on the other hand, consists of sevaral utterly vast pages, so each index point takes you to the middle of one of these pages, and you can't feel where you are. The style and cross-reference just cut it, either. It's even got black text on a grey background just to make it just that little bit harder to read. Yuk.

1 out of 10. Could do better.

Michael

8:51 pm on July 17, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 8, 2002
posts:65
votes: 0


I'm sorry, I must have missed something there.

Help file?

I just use their search function on their site. Just put "blob" into the top right text box, go from there. Heaps of info.

9:06 pm on July 17, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 7, 2003
posts:1230
votes: 0


hi MTKilpatrick,

the best documentation is always online [mysql.com] (download and browse-able).

if you would like to have it on your harddisk, then there is only one page per chapter (or all in one page) and that are really bigger documents. db engeneers tend to have machines with lots of ram i think... ;).

nevertheless you can try to mirror the online docs on your harddisk. on windows HTTrack [httrack.com] does a really good job with lots of useable options to download only the manual (windows, open source).

maybe this will lead you to a 'more paged' manual.

-hakre