title: SQL search articles by tag when the tag is formatted and retrieved from the url
body: <p>How do I write a (MySQL) query to find rows where a column contains value obtained from a url query string?</p>
  
  <p>I can do <code>SELECT * FROM table WHERE column LIKE %tag%</code>, which is fine when the tag is a single word. However I want to support tags made up of multiple words.</p>
  
  <p>To make my URLs nice I'm stripping out certain characters and replacing spaces with dashes. For example a tag like "Stack Overflow" would become "stack-overflow" when retrieved from the URL as a query string.</p>
  
  <p>It would also be nice to support tags with punctuation like "17/18" which would get converted to "17-18", or "how's it going?" which would get converted to "how-s-it-going", or "Movie 2: The revenge" which would get converted to "movie-2-the-revenge".</p>
  
  <p>I can't figure a way to do it. Will I need something like a permalink column for my tags and use that to store the url converted tag?</p>