471,084 Members | 1,034 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,084 software developers and data experts.

formatting text

Tim
Hi Guys

I have a mysql database that contains guitar tabs and song lyrics (kind of
like my own personal taborama.com),anyway 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

Jul 19 '05 #1
2 2262
On Tue, 13 Jan 2004 01:57:06 GMT, in mailing.database.mysql "Tim"
<ti*******@sterlingmicros.com.au> wrote:
| Hi Guys
|
| I have a mysql database that contains guitar tabs and song lyrics (kind of
| like my own personal taborama.com),anyway 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?


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;
---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 19 '05 #2
On Tue, 13 Jan 2004 01:57:06 GMT, in mailing.database.mysql "Tim"
<ti*******@sterlingmicros.com.au> wrote:
| Hi Guys
|
| I have a mysql database that contains guitar tabs and song lyrics (kind of
| like my own personal taborama.com),anyway 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?


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;
---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Bradley | last post: by
7 posts views Thread by BBFrost | last post: by
14 posts views Thread by Scott M. | last post: by
3 posts views Thread by michael sorens | last post: by
3 posts views Thread by =?Utf-8?B?b24tbGluZSBqb3VybmFsIGVkaXRvcg==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.