title: Can't update data in to mysql through php
body: <p>I have problem.
  I'm trying to make a CMS, but I cant update my data through php.
  They are variables and it didn't accept my query, but when I used static values it updated.
  Here's my code.
  Error I have is $menu1 is undefined</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
      &lt;meta name="author" content="Robert Michalski"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;CSS&lt;/h1&gt;
      &lt;h2&gt;+HTML 5&lt;/h2&gt;
          &lt;form action="index.php" method="post"&gt;
              Edycja menu
              &lt;input type="text" name="menu1" placeholder="menu1"&gt;
              &lt;input type="text" name="menu2" placeholder="menu2"&gt;
              &lt;input type="text" name="menu3" placeholder="menu3"&gt;
              &lt;input type="text" name="menu4" placeholder="menu4"&gt;
              &lt;input type="submit" name="button" value="save"&gt;
      &lt;/form&gt;
      &lt;?php
  
          $servername = "localhost";
          $username = "root";
          $password = "";
          $dbname = "wia27";
          // Create connection
          $conn = new mysqli($servername, $username, $password, $dbname);
          // Check connection
          if ($conn-&gt;connect_error) {
              die("Connection failed: " . $conn-&gt;connect_error);
          } 
  
          $sql = "UPDATE menu SET menu1='$menu1' WHERE id=1";
          if ($conn-&gt;query($sql) === TRUE) {
          } else {
              echo "Error updating record: " . $conn-&gt;error;
          }
  
          $conn-&gt;close();
      ?&gt;
      &lt;section&gt;
          &lt;article&gt;
              &lt;h3&gt;box&lt;/h3&gt;
              &lt;p&gt;Lorem ipsum&lt;/p&gt;
          &lt;/article&gt;
          &lt;div class="ads"&gt;
              &lt;div class="little_ad"&gt;
                  Box1
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/section&gt;
      &lt;footer&gt;
          Robert Michalski 2016 &amp;copy;
      &lt;/footer&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>