title: MySQL multiple variables in LEFT JOIN
body: <p>I have table <code>dates</code> as following</p>
  
  <pre><code>"dates"  "one" "two"  "three" "four"
  date1    id1    id2    id3    id4
  date2    id3    id1    id4    id2
  </code></pre>
  
  <p>and a second table  <code>id2name</code></p>
  
  <pre><code>"ids"  "names"
  id1    name1
  id2    name2
  id3    name3
  id4    name4
  </code></pre>
  
  <p>I have a mental block trying to write</p>
  
  <pre><code>SELECT * FROM dates WHERE `date`='$date' LEFT JOIN `id2name` ON ...
  </code></pre>
  
  <p>What clause do I put in ON to get names instead of IDs?</p>