title: POST method not inserting data into database table
body: <p>I'm trying to play around with databases and inserting data dynamically with php.
  At the moment I have a form with 'post' method and everything seems logical to me but it isn't inserting the data into the table.</p>
  
  <p>Code is attached below, would appreciate if someone could point me into the right direction.</p>
  
  <p><strong>index.php:</strong></p>
  
  <pre><code>&lt;form action="index.php" method="post"&gt;
  
  &lt;label for="name"&gt;Name&lt;/label&gt;
  &lt;input type="text" name="name" required&gt;
  
  &lt;label for="breed"&gt;Breed&lt;/label&gt;
  &lt;input type="text" name="breed"&gt;
  
  &lt;label for="age"&gt;Age&lt;/label&gt;
  &lt;input type="text" name="age"&gt;
  
  &lt;input type="submit" name="submit" value="Submit"&gt;
  
  &lt;/form&gt;
  
  &lt;?php
  
  require "connect.php";
  
  if('submit') {
      $name = $_POST['name'];
      $breed = $_POST['breed'];
      $age = $_POST['age'];
  
      $newdog = mysqli_query('INSERT INTO `dogs`(`name`, `breed`, `age`) VALUES ([$name],[$breed],[$age)');
  
      if ($newdog) {
          echo "$name has been added to the database";
      } else {
          echo "$name has not been added to database.";
      };
  };
  
  ?&gt;
  </code></pre>
  
  <p><strong>connect.php:</strong></p>
  
  <pre><code>&lt;?php
  
  $connect = mysqli_connect('localhost', 'max', 'password', 'db_test');
  
  ?&gt;
  </code></pre>