I am making logins for a school website and I have a list of names, first name + surname.
Now I have this code:
UPDATE tblusers t1
INNER JOIN
(
SELECT
UserId,
CONCAT(SUBSTRING(Surname, 1 ,4), SUBSTRING(Firstname,1,4)) Login
FROM tblusers
) t2 ON t1.UserId = t2.UserId
SET t1.login = t2.login
example: Johny bravo will have the loginname bravjohn.
But when someone is called “Van Mullem Arnault” this becomes Van Arna
How do I het rid of that space? or a “-” sign for special names.
So i actually want for “Van Mullem Arnault” –> VanMArna
I have been looking on the net and here but not really something intesting to find.
Thank you for looking into it 🙂
Use MySQL Replace