Re: line breaks in mySQL text fields
| From: | Dobromir Velev | Date: | Tue, 24 Jul 2001 07:47:42 +0000 |
| Subject: | Re: line breaks in mySQL text fields | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-10701@lists.php.net to get a copy of this message | ||
Hi,
You could put "\n" where you want the new line.
Than if you want to output the text field in HTML you could use nl2br() to
replace the new line characters with <br>
For example take a look at this INSERT query:
$sql= "INSERT INTO table_name (text_field,...other_fields) VALUES ('first
row\nsecond row',...other_values)";
Hope this helps
Dobromir Velev
-----Original Message-----
From: kmurrah <kmurrah@bakergrfx.com>
To: php-db@lists.php.net <php-db@lists.php.net>
Date: Monday, July 23, 2001 9:15 PM
Subject: [PHP-DB] line breaks in mySQL text fields
>How do I add new line characters to a text field in mySQL ?
>
>i.e. i need to manually insert "returns" into my text ...
>
>thanks in advance,
>
>KennM
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>For additional commands, e-mail: php-db-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>