Here is an easy solution with a single query :
UPDATE `my_table` SET alias = lower(name),
alias = replace(alias, '.', ' '),
alias = replace(alias, ''', '-'),
alias = replace(alias,'?','s'),
alias = replace(alias,'D','Dj'),
alias = replace(alias,'?','z'),
alias = replace(alias,'T','B'),
alias = replace(alias,'?','Ss'),
alias = replace(alias,'à','a'),
alias = replace(alias,'á','a'),
alias = replace(alias,'a','a'),
alias = replace(alias,'?','a'),
alias = replace(alias,'?','a'),
alias = replace(alias,'?','a'),
alias = replace(alias,'?','a'),
alias = replace(alias,'?','c'),
alias = replace(alias,'è','e'),
alias = replace(alias,'é','e'),
alias = replace(alias,'ê','e'),
alias = replace(alias,'?','e'),
alias = replace(alias,'ì','i'),
alias = replace(alias,'í','i'),
alias = replace(alias,'?','i'),
alias = replace(alias,'?','i'),
alias = replace(alias,'e','o'),
alias = replace(alias,'?','n'),
alias = replace(alias,'ò','o'),
alias = replace(alias,'ó','o'),
alias = replace(alias,'?','o'),
alias = replace(alias,'?','o'),
alias = replace(alias,'?','o'),
alias = replace(alias,'?','o'),
alias = replace(alias,'ù','u'),
alias = replace(alias,'ú','u'),
alias = replace(alias,'?','u'),
alias = replace(alias,'y','y'),
alias = replace(alias,'y','y'),
alias = replace(alias,'t','b'),
alias = replace(alias,'?','y'),
alias = replace(alias,'?','f'),
alias = replace(alias, '?', 'oe'),
alias = replace(alias, '€', 'euro'),
alias = replace(alias, '$', 'dollars'),
alias = replace(alias, '£', ''),
alias = trim(alias),
alias = replace(alias, ' ', '-'),
alias = replace(alias, '--', '-') ;
In this example :
- 'my_table' is the name of the table,
- 'name' is the original field
- 'alias' is the name of my slug field
Hope it helps !