Forum Moderators: coopster

Message Too Old, No Replies

PHP MYSQL data retrieval of text

         

chupcha

2:20 am on Oct 11, 2005 (gmt 0)

10+ Year Member



Hey all,

I have a form where users are allowed to write almost an essay and save it to mysql. I have MYSQL save teh data as "mediumtext". The data is submitted through a textarea.

The problem is when I try to output the data, PHP prints out everything except the line breaks. Like everything is all in one big paragraph.

Is there a way to fix this?

Thanks,
Roman

tata668

2:33 am on Oct 11, 2005 (gmt 0)

10+ Year Member



nl2br [ca3.php.net] maybe?

omoutop

9:34 am on Oct 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



yeap...nl2br is great for that job...

example

$info2 = $HTTP_POST_VARS['info'];
$info = nl2br($info2);

dreamcatcher

10:29 am on Oct 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually omoutop, $HTTP_POST_VARS is now deprecated and shouldn`t be used. Always use $_POST.

dc

chupcha

4:26 pm on Oct 13, 2005 (gmt 0)

10+ Year Member



cool, thanks, it worked!