title: MySQL database connection problem
body: <p>I'm trying to connect to a database from my script, but keep getting the error: "Cannot select the database"</p>
  
  <p>here's the config.php file</p>
  
  <pre><code>&lt;?php
  $hostname = 'localhost'; //it's localhost in all all cases
  $db_username = 'root@localhost';
  $db_password = '';
  $dbname = 'function';
  $link = mysql_connect($hostname, $db_username, $db_password) or die("Cannot connect to the database");
  mysql_select_db($dbname) or die("Cannot select the database");
  ?&gt;
  </code></pre>
  
  <p>I'm using XAMPP on Windows, have created a database called function, with no password,  running locally.  I still can't figure out why it's not selecting the database.</p>