For outputting plain text in a Db field i use this function
function text_format($string)
{
// check for carrage returns
$cr_pass = eregi_replace("\r", "<br>", $string);
// check for http creater hyperlink
$url_pass = ereg_replace("http://(([A-Za-z0-9.\-])*)([a-zA-Z0-9])", "<a href=\"\\0\">\\0</a>",$cr_pass);
// check for @ create mailto:
$mail_pass = ereg_replace("(([A-Za-z0-9.\-])*)\@(([A-Za-z0-9.\-])*)", "<a href=\"mailto:\\0\">\\0</a>",$url_pass);
// print the modified string
echo $mail_pass;
}
then call it with text_format($your_db_text);
echo $outout_text;
you might want to add htmlspecialchars() into that too to avoid rogue HTML from breaking your page
hope this helps you!
ash