title: Read single value from database and save it in variable
body: <p>I have a small table in my database which looks like this:</p>
  
  <pre><code>----------------------
  id | name      | value
  ----------------------
  1  | test.flag | 0
  ----------------------
  2  | username  | franz
  ----------------------
  </code></pre>
  
  <p>I simply try to read the value of <code>test.flag</code> and store the result in a variable.</p>
  
  <pre><code>&lt;?php
  
      $servername = "127.0.0.1";
      $username   = "test";
      $password   = "test123";
      $dbname     = "testdb";
  
      $conn = mysqli_connect($servername, $username, $password, $dbname);
  
      if (!$conn)
      { 
          die("Connection to database failed with error#: " . mysqli_connect_error()); 
      }   
  
      $sql = "SELECT value FROM mytable WHERE name='test.flag';";
  
      $result = mysqli_query($conn, $sql);
      echo "&lt;p&gt;".$result."&lt;/p&gt;&lt;br&gt;";
  
      if (mysqli_query($conn, $sql))
      {
          echo "&lt;p&gt;Sucessfully&lt;/p&gt;&lt;br&gt;";
      } else {
          echo "Error: " . $sql . "&lt;br&gt;" . mysqli_error($conn);
      }
  
      echo "&lt;p&gt;".$sql."&lt;/p&gt;&lt;br&gt;";
  ?&gt;
  </code></pre>
  
  <p>But it loads a blank page after I execute this <code>script.php</code> file.</p>