1
I have a Text field called INFORMATION in my Mysql table containing data in multiple rows:
Joseph,
Maria,
Melissa,
When I convert to HTML the result appears in a single line: Jose, Maria, Melissa,
I tried to include the tag < br> at the end of each line using a SELECT, but not successful.
I tested:
SELECT INFORMATION FROM my_table WHERE REPLACE(INFORMATION,' r n','< br>');
As a result I got 34 lines changed, but I don’t understand this result, because my table contains more than 2,000 records, and all records have more than three lines in the field INFORMACOES
.
Have a similar question on How to break a line of a Mysql field into an HTML page but there teaches how to insert data with break row in the Mysql table. I don’t want to insert, I want to extract them from the table to an HTML page with a break for each row, which are all in the same field.
How do I do it?
I found a solution to my problem: (1) I cloned my table, (2) Using an UPDATE I changed the line break ' n r' by '< br>' in the cloned table. (3) I converted the records of the cloned table into HTML, preserving the original table. Everything worked out. (4) Finally I deleted the cloned table. This process was very fast, as I wanted. Anyway thanks for your help. I will test your reply, then I inform here the result.
– Luiz
Only now I found time to test the use of the function "nl2br, but I did not find this function. I think it is for PHP, but I use Delphi. Thanks for the tip.
– Luiz