Hướng dẫn new line in mysql
Could someone tell me how to add a new line in a text that I enter in a MySql table? I tried using the Actually I have created a table in MS Access with some data. MS Access adds new line with Can anyone tell me how MySQL can add a new line in a text? Awaiting response, thanks!!
Alexis Wilke 17.7k10 gold badges74 silver badges134 bronze badges asked May 25, 2010 at 7:50
Muhammed UmerMuhammed Umer 1,0211 gold badge8 silver badges6 bronze badges 1 If you're OK with a SQL command that spreads across multiple lines, then oedo's suggestion is the easiest:
I just had a situation where it was preferable to have the SQL statement all on one line, so I found that a combination of
answered Feb 11, 2011 at 18:10
Don KirkbyDon Kirkby 49.3k25 gold badges195 silver badges275 bronze badges 2 in an actual SQL query, you just add a newline
answered May 25, 2010 at 7:54
For the record, I wanted to add some line breaks into
existing data and I got Sample data:
I did:
However, it also worked with just
bluish 25.2k26 gold badges115 silver badges175 bronze badges answered Dec 10, 2010 at 16:52
MattMatt 2713 silver badges2 bronze badges 6
answered May 3, 2012 at 14:39
xtdsxtds 2,3832 gold badges18 silver badges11 bronze badges 2 MySQL can record linebreaks just fine in most cases, but the
problem is, you need Just use it like this:
Output (in HTML):
Here's a link to the manual: http://php.net/manual/en/function.nl2br.php
answered Nov 30, 2014 at 11:27
starleaf1starleaf1 2,4125 gold badges39 silver badges61 bronze badges 1
JSW189 6,17711 gold badges42 silver badges71 bronze badges answered Apr 5, 2013 at 22:05
0 First of all, if you want it displayed on a PHP form, the medium is HTML and so a new line will be rendered with the answered May 25, 2010 at 7:53
David MDavid M 70.2k13 gold badges154 silver badges184 bronze badges In SQL or MySQL you can use the
bluish 25.2k26 gold badges115 silver badges175 bronze badges answered May 25, 2010 at 8:15
RandyMorrisRandyMorris 1,2649 silver badges17 bronze badges 1
answered Jun 14, 2012 at 8:02
AirfulAirful 3102 silver badges12 bronze badges 7 use answered Apr 12, 2021 at 7:42
Adding to the answer given @DonKirby
is unnecessary The See - https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_char Thus more appropriate would be to use answered Oct 2, 2021 at 22:34
Payel SenapatiPayel Senapati 8941 gold badge9 silver badges22 bronze badges 1 You can simply replace all
answered May 4, 2012 at 10:34
uttamuttam 5892 gold badges7 silver badges32 bronze badges Not the answer you're looking for? Browse other questions tagged mysql newline insert-into or ask your own question. |