title: MySQL insert into with subquery (on a junction table)
body: <p>Basically, I'd like to insert into a junction table, getting values from another one.</p>
  
  <p>Like this:</p>
  
  <pre><code> $sql= "INSERT INTO cars_owners (car_id, owner_id ) VALUES ($id, SELECT owners.owner_id FROM owners WHERE owners.owner_name='$name'))";
  </code></pre>
  
  <p>However, this one does not work, anyone know why?</p>