Blank spaces in database and in Javascript view

0

I have a database of books in which in the fields of titles some spaces is another character so it does not identify it as such

That makes that in my view when wanting to list books I do not make the line jump

As you can see some titles do not make the line break because spaces as such are not spaces. I already tried to do a replace but it does not identify the spaces, either with a .split (). Join () because it does not identify it either

Here is the example of joining them with commas to check that they do the methods correctly but that they do not identify the spaces and therefore they do not

Any ideas to solve it? I saw that in the base of tatos erasing those "spaces" and putting the space well solves it (change it manually). But they are more than 6000 titles, I would not like to do it manually

    
asked by Javi Tellez 11.11.2018 в 09:27
source

1 answer

1

Well, there are several ways to do this, it is best to normalize it and not do it in each query. The reason is that you generate more load when reading the data.

BEFORE DOING THIS MAKE A COPY OF THE DATABASE

How to solve it I can think of 2 ways

1. Option if it is a table with a field

update [nombre tabla] set [nombre del campo] = replace([nombre del campo],'[simbolo o caracter a remplazar]',CHAR(10) + CHAR(13));

2. If there is more than one table that has this problem and there are several fields

Doing a dump of the database to a sql make the change with find and replace some text editor and reimport the database

Dump

mysqldump -u root -p [password] [database name] > basededatos.sql

Restore the database

mysql -u root -p [password] [database name] < basededatos.sql

    
answered by 11.11.2018 / 11:40
source