Formatted text from mySQL DB

From: Date: Tue, 05 Aug 2003 13:13:45 +0000
Subject: Formatted text from mySQL DB
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-158274@lists.php.net to get a copy of this message
Astrum Et Securis! I had a question.. When I create any field and let data be sent into my mySQL DB through it.. it goes ok. But when I retrieve it.. the data comes completely unformatted. That is.. let's say I fed this in a textarea.. The Man Is Cool. If I view the data from my phpMyAdmin or even Command Line mySQL.. the data has gone just this way.. But when I use mysql_fetch_array() to get the data back from mySQL, it prints as .. The Man Is Cool. The newline disappears, and I have to use <br>'s while feeding the data to have the line gaps. What am I doing wrong? Following is an example code of what I use.. <? while ($result = mysql_fetch_array($query)) { echo " $result[data] <br> "; } ?> If the data stored in 'data' was multiple lines.. I would get one single line from the Database.. not as I had sent it in. Dominor! PHPSpooky

« previous php.general (#158274) next »