Skip to content

Instantly share code, notes, and snippets.

@RakibSiddiquee
Created January 21, 2019 11:04
Show Gist options
  • Save RakibSiddiquee/440cb46860e1aeb5f6015011f4dd5f9a to your computer and use it in GitHub Desktop.
Save RakibSiddiquee/440cb46860e1aeb5f6015011f4dd5f9a to your computer and use it in GitHub Desktop.
Make slug of a column in MySQL database and update
UPDATE table SET domain = LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM(name), ':', ''), '’', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment