My MySQL table has a nom fied varchar(60) utf-general-ci and there are rows like this: nom = " ANA MARIA" I run this: UPDATE table SET nom = Replace(nom, ' ', ' ') PHP: But nothing.
Of course it won't work. Your variable nom has ONE space, three letters, ONE space, and five letters. You can't delete single spaces separated by other printable characters using double spaces in your code. Just use single spaces in your code, and the single spaces will disappear leaving you with what you want 'ANAMARIA'
Or just use trim() around the variable, preferably before you put it into your database. Don't try to fix data already in the database, that's a waste of time and resources, fix it preferably before you put the data in, or fix it when it's displayed.