Mysql and css formatted text

software development

#1

i have pages of text that we would like to get in to a database.

i am attempting to pull most of the content into a database.

the text has css formatted headlines, text, subheads, bulleted lists

  • and i don’t want to break them up into separate fields in the database as the text doesn’t flow the same for each…so i want i all in the same database field, ie course_description, which i now have as long text. but…the drawback i found is in the css and html tags

    i now get from what was a
    tag,
    r/n/ etc.

    is there some mysql editor or tutorial to tell me how to approach this? i have googled for a few hours, and posted in mysql php forums…but have not received a good answer yet…thought some guru here could enlighten me…

    thanks


  • #2

    What you are trying to do is quite an involved process. You will need to setup a MySQL database in the control panel, and then use phpMyAdmin to build a suitable table to hold your data. To keep your “entries” separate, I recommend a table with fields like this:id INT(6) - holds a unique number for each entry timestamp TIMESTAMP - the date and time of each entry body TEXT - holds the complete HTML of each entryYou will be able to access that data by using the unique ID number of each entry, and generate a PHP page that refers to it with a URL like this:http://example.com/?id=242By adding a “slug” field (a short description that represents the entry), you can use mod_rewrite to make prettier URLs like this:http://example.com/2007/10/07/dreamhost-is-awesome/You will need to learn how to store HTML in a MySQL “TEXT” field and then extract it again with PHP. If you are using PHP4, you can let “magic quotes” handle it for you; however, I recommend that you use PHP 5 and learn how to do it properly.

    si-blog
    Max discount on any plan with promocode SCJESSEYTOTAL