How to create a slug
from the name
of an item in MySQL/MariaDB.
UPDATE my_table
SET slug = LOWER(REGEXP_REPLACE(REPLACE(REPLACE(REPLACE(name, ' ', '-'), 'and', '-'), '[^a-zA-Z0-9-]', ''), '-+', '-'));
How to create a slug
from the name
of an item in MySQL/MariaDB.
UPDATE my_table
SET slug = LOWER(REGEXP_REPLACE(REPLACE(REPLACE(REPLACE(name, ' ', '-'), 'and', '-'), '[^a-zA-Z0-9-]', ''), '-+', '-'));