title: insert data to mysql database from multiple select list (html form)
body: <p>I make a form, where there is ID of a shop: </p>
  
  <pre><code>&lt;input type="text" name="shopId"&gt;
  </code></pre>
  
  <p>and there is a multiple choice select:</p>
  
  <pre><code>&lt;select name="cars" multiple required&gt;
  </code></pre>
  
  <p>after i get selected options, i have to pass them to a table in the database; table consists of 2 columns: shopId and car. The thing is it passes only one option and it is impossible to have a few rows added to the table like in one shop two or three models. I suppose i have to pass the data like an array or something. Can you help me, please.</p>
  
  <pre><code>$shopId = $_GET["shopId"];
  $cars = $_GET["cars"];
  </code></pre>
  
  <p>this is a query:</p>
  
  <pre><code>$query = "INSERT INTO shops (shopId, car) VALUES ($shopId, $cars)";
  </code></pre>