title: PHP - Select sql from html checkbox
body: <p>I have an html form, with some checkbox.
  <a href="https://i.stack.imgur.com/5ef4h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5ef4h.png" alt="My form with 4 checkbox"></a></p>
  
  <p>I want to write an sql to include my checkbox. <br></p>
  
  <p>For example on my Database: <br>
  Column: <strong>Stato</strong> <br>
  Options: <strong>0,1,2,3</strong> <br> Where: </p>
  
  <ul>
  <li>0 = Aperto,</li>
  <li>1 = Stampato,</li>
  <li>2 = Bloccato,</li>
  <li>3 = ❤ (Favorite),</li>
  </ul>
  
  <p>So, if they are all selected you must show me all kinds, otherwise not. <br></p>
  
  <p>How can I write sql?</p>
  
  <p><strong>This is my checkbox:</strong></p>
  
  <pre><code>&lt;div id="radioset"&gt;
          &lt;input type="checkbox" id="radio1" name="aperto" checked="checked"&gt;&lt;label for="radio1"&gt;Aperto&lt;/label&gt;
          &lt;input type="checkbox" id="radio2" name="stampato" checked="checked"&gt;&lt;label for="radio2"&gt;Stampato&lt;/label&gt;
          &lt;input type="checkbox" id="radio3" name="bloccato" checked="checked"&gt;&lt;label for="radio3"&gt;Bloccato&lt;/label&gt;
          &lt;input type="checkbox" id="radio4" name="favorite" checked="checked"&gt;&lt;label for="radio4"&gt;&amp;#9829&lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And this is my PHP sql:</p>
  
  <pre><code>$input=$_POST['input'];
  $id=$_POST['id'];
  $tipo=$_POST['tipo'];
  $numero1=$_POST['numero1'];
  $numero2=$_POST['numero2'];
  $data1=date('d/m/Y', strtotime($_POST['from']));;
  $data2=date('d/m/Y', strtotime($_POST['to']));;
  
  $sql="SELECT [Id Ord] AS [ID], [Tipo Ord] AS [Tipo], [N Ord] AS [Numero], [Data Ord] AS [Data], [Ragione Sociale], [Indirizzo], [TotImp] AS [IMPORTO TOTALE], [TotIva] AS [IMPORTO IVA] FROM [Ordini] WHERE [Id Ord] LIKE '$id' OR [Tipo Ord] LIKE '$tipo' OR [Data Ord] BETWEEN #$data1# AND #$data2#";
  
  $rs = $con-&gt;execute($sql);
  </code></pre>
  
  <p>Thanks!</p>