Skip to content

Instantly share code, notes, and snippets.

View CristhianBoujon's full-sized avatar

Cristhian Boujon CristhianBoujon

View GitHub Profile
@CristhianBoujon
CristhianBoujon / gist:ffbb5c2ac7f861c8a65244398b11ff02
Created May 8, 2017 20:25 — forked from matoakley/gist:1092571
MySQL to convert a string into a slug
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`