title: PHP Page: No database selected issue
body: <p>I get <code>No database selected on line 13</code> error. And this code line is </p>
  
  <pre><code>$result = $mysqli-&gt;query($query) or die($mysqli-&gt;error." on line ".__LINE__);
  </code></pre>
  
  <p>Database connected successfully but when I try to open "question.php" file I get this error.</p>
  
  <pre><code>&lt;?php
       // Set question number
       $number = (int) $_GET['n'];
  
       /*
       * Get Question
       */
       $query = "SELECT * FROM questions WHERE questions.question_number = $number";
  
      // Get Result
  
      $result = $mysqli-&gt;query($query) or die($mysqli-&gt;error." on line ".__LINE__);
  
      $question = $result-&gt;fetch_assoc();
  
  
      /*
      * Get Choices
      */
      $query = "SELECT * FROM choices WHERE question_number = $number";
  
     // Get Results
     $choices = $mysqli-&gt;query($query) or die($mysqli-&gt;error.__LINE__);
  
  ?&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong>!</p>
  
  <p>My database connection:</p>
  
  <pre><code>&lt;?php
  
      // Create connection credentials
      $db_host = 'localhost';
      $db_name = 'quizzer';
      $db_user= 'root';
      $db_pass='';
  
      // Create mysqli object
  
      $mysqli = new mysqli($db_host, $db_user,$db_pass,$db_pass);
  
      // Error handler
      if($mysqli-&gt;connect_error){
          printf("Connect failed: %s\n", $mysqli-&gt;connect_error);
          exit();
  }
  </code></pre>