title: Post query from php to sqlite database through button
body: <p>So I have the following webpage containing html and php. Within the page I have a checkbox which populates its options from a table within the database. and another multi-select checkbox that gets populated from a different table. The first checkbox is related to products and the second is store location which can have multiple locations.</p>
  <p>I'm trying to setup a submit button after something is selected from both it posts to the database within the table to give store location details for each product.</p>
  <p>table schema:</p>
  <p>table name: products</p>
  <pre><code>id, name, StoreLocation
  </code></pre>
  <p>table name: stores</p>
  <pre><code>id, name
  </code></pre>
  <p>how I am using the product checkbox</p>
  <pre><code>  &lt;select name=&quot;Pname&quot;&gt;
  &lt;?php
  
    $resultSet = $db-&gt;query('SELECT name FROM products');
    while($row = $resultSet-&gt;fetchArray()){
      
      echo&quot;&lt;option value=\&quot;productN\&quot;&gt;&quot; . $row['name'] . &quot;&lt;/option&gt;&quot;;
    }
  ?&gt;
  &lt;/select&gt;
  </code></pre>
  <p>store location checkbox</p>
  <pre><code>&lt;select name=&quot;Sname&quot;, id=&quot;Sname&quot; multiple&gt;
  &lt;?php
  $resultSet = $db-&gt;query('SELECT name FROM stores');
    while($row = $resultSet-&gt;fetchArray()){
      
      echo&quot;&lt;option value=\&quot;storeN\&quot;&gt;&quot; . $row['name'] . &quot;&lt;/option&gt;&quot;;
    }
  ?&gt;
  &lt;/select&gt;
  </code></pre>
  <p>This is what I was attempting but it did not work</p>
  <pre><code>&lt;form action=&quot;index.php&quot; method=&quot;post&quot;&gt;
  &lt;input type=&quot;submit&quot; name=&quot;myButton&quot; value=&quot;Submit&quot;/&gt;
  &lt;?php
      $query = &quot;INSERT INTO products (Store Location) VALUES ($row)&quot;;
  ?&gt;
  &lt;/form&gt;
  </code></pre>
  <p>Is it a problem with my setup for the sql query? When I try to use the submit button nothing is inserted to the database. I've tried sample queries and those did not work either.</p>