title: MySQL "no database selected"
body: <p>I am using the following code to connect to my database. I get a no database selected error.</p>
  
  <pre><code>    require '../dbconnect.php';
  
  session_start();
  
  $username_input = $_POST['username_input'];
  $password_input = $_POST['password_input'];
  
  $sql = "SELECT id, username, password, salt FROM users WHERE username = '$username_input' LIMIT 0, 30";
  $query = mysqli_query($dbcon, $sql);
  
  printf("Error: %s\n", mysqli_error($dbcon));
  exit();
  
      $row = mysqli_fetch_row($query);
      $user_number = $row[0];
      $username = $row[1];
      $password = $row[2];
      $salt = $row[3];
  </code></pre>
  
  <p>I know similar questions have been asked in the past, but looking through those, I could not find my problem.</p>