title: matching comma separated string to ids mysql
body: <p>I have 2 tables</p>
  
  <ol>
  <li>Users</li>
  <li>Locations</li>
  </ol>
  
  <p>now 90% of the time 1 user is connected to 1 location. But now a scenario has come up where 1 user has 2 locations</p>
  
  <p>I have done this</p>
  
  <pre><code>Locations table
  id     name
  1      A
  2      B
  3      C 
  </code></pre>
  
  <p>users table</p>
  
  <pre><code>id     location_id
  1      1
  2      1
  3      1,2
  </code></pre>
  
  <p>now i want to do a query where i can match a comma separated string like 1,2 to the table locations an get 1 and 2.</p>
  
  <p>What is the best way to do this? </p>