formatting text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim

    #1

    formatting text

    Hi Guys

    I have a mysql database that contains guitar tabs and song lyrics (kind of
    like my own personal taborama.com),a nyway i have everything stored in the
    database and use php to display all the records on a web page but my problem
    is i can't keep any of the formatting for the tabs or lyrics, i enter
    everything into the database via mysqlcc. When i enter the tabs in mysqlcc
    it all looks nice and formatted but when i print it in php it all goes on
    one line, is there anyway of preserving the format of the text in the mysql
    database or should this question be aimed at a php newsgroup?

    Cheers

    Tim



  • Jeff North

    #2
    Re: formatting text

    On Tue, 13 Jan 2004 01:57:06 GMT, in mailing.databas e.mysql "Tim"
    <timnospam@ster lingmicros.com. au> wrote:
    [color=blue]
    >| Hi Guys
    >|
    >| I have a mysql database that contains guitar tabs and song lyrics (kind of
    >| like my own personal taborama.com),a nyway i have everything stored in the
    >| database and use php to display all the records on a web page but my problem
    >| is i can't keep any of the formatting for the tabs or lyrics, i enter
    >| everything into the database via mysqlcc. When i enter the tabs in mysqlcc
    >| it all looks nice and formatted but when i print it in php it all goes on
    >| one line, is there anyway of preserving the format of the text in the mysql
    >| database or should this question be aimed at a php newsgroup?[/color]

    The only way is not to display your data in a web page. Browser ignore
    whitespace characters like tabs, more than 1 space character and new
    lines.

    A method would be to read in your record and use regex instructions to
    convert tabs to several &nsbp; characters, change newlines to <BR> (or
    </P><P>" instructions and spaces to a single &nbsp;
    ---------------------------------------------------------------
    jnorth@yourpant sbigpond.net.au : Remove your pants to reply
    ---------------------------------------------------------------

    Comment

    Working...