title: No Database Selected in PHP MySqli
body: <p>I have switched to MySQLi and am having some issues when loading up a login page. I get the error "No database selected".</p>
  
  <p>This is my connection code.</p>
  
  <pre><code>&lt;?php
  // config
  
  $config['host'] = "";
  
  $config['user'] = "";
  
  $config['pass'] = "";
  
  $config['db'] = "";
  
  // the @ sign is an error supressor, meaning we can use our own error messages, this connects and selects db
  @($GLOBALS["___mysqli_ston"] = mysqli_connect(
      "$config[host]", "$config[user]", "$config[pass]"
  )) 
  or die("error :".((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))."");
  @((bool)mysqli_query($GLOBALS["___mysqli_ston"], "USE " . $config['db'])) 
  or die("error:".((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))."");
  
  ?&gt;
  </code></pre>