title: mySQL: How do I combine a search value with a variable?
body: <p>I'm sure that there is a stupidly simple solution to this, but unfortunately my google-fu is too weak to find it.</p>
  
  <p>I have a number of different tables for sizing, all following the same naming convention i.e size_001, size_002 etc. Within a loop I need to get the size entry that matches with the results already found.</p>
  
  <p>Unfortunately there are no totally unique identifiers, as they repeat in each table (roman numerals for sizing). But they are unique in each <em>individual</em> table. So what I've tried so far looks a little bit like this:</p>
  
  <pre><code>SELECT * FROM CONCAT('size_00', '.$sizeTableID[$j].') WHERE sizeName LIKE '$sizeNames[$j]'"
  </code></pre>
  
  <p>Where $sizeTableId is a number from 1-9 and sizeName is a string e.g II or VI or, occasionally (because there's no consisitency), 2 etc</p>
  
  <p>I've also tried ''$var'' inside the CONCAT and not using the CONCAT at all. Really I just need a way to join the database.size_00 and an integer variable.</p>