title: How exactly do I make a button start a database (sql) query in php?
body: <p>I'm trying to create a feedback page on this website I'm coding and I need my submit button to start a query so that the message is sent and stored in a feedback table in my database.</p>
  
  <p>But I can't seem to be able to find the reason my implementation does not work. I think it worked this way the last time, any help would be appreciated.</p>
  
  <pre class="lang-php prettyprint-override"><code>                       &lt;div class="form-group"&gt;
                             &lt;label for="msgType"&gt;What is your concern?&lt;/label&gt;
                              &lt;select name="msgType" method="post" class="form-control input-lg" id="msgType"&gt;
                                  &lt;option value="1"&gt;I wish to report incorrect information cited on the website.&lt;/option&gt;
                                  &lt;option value="2"&gt;I wish to report the existence of another bistro.&lt;/option&gt;
                                  &lt;option value="3"&gt;I wish to thank the admin personally.&lt;/option&gt;
                                  &lt;option value="4"&gt;I wish to express some other concern.&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt; 
                          &lt;div class="form-group"&gt;
                              &lt;label for="message"&gt;Your message:&lt;/label&gt;
                              &lt;textarea class="form-control" method="post" rows="15" id="message" name="message" placeholder="Thou, dear customer, may express Your concern here in any extent or form your majesty finds appropriate."&gt;&lt;/textarea&gt;
                          &lt;/div&gt; 
                          &lt;button type="submit" class="btn btn-info"&gt;Send&lt;/button&gt;
                          &lt;input type="hidden" name="submitted_feedback" value="1"&gt;
                      &lt;/div&gt;
                  &lt;/section&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/section&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;!-- QUERY SECTION --&gt;
  &lt;?php 
  
  if(isset($_POST['submitted_feedback']) == 1)
  {
      $message = mysqli_real_escape_string($dbc, $_POST['message']);
  
      $q = "INSERT INTO feedback(type, message) VALUES ($_POST[msgType], '$message')";
      $r = mysqli_query($dbc, $q);
      echo 'dis is running';
      if($r)
      {
          echo "&lt;script type='text/javascript'&gt;alert('Your message was sent! :)');&lt;/script&gt;";
      } 
  }
  ?&gt;
  </code></pre>