title: Connecting to mySQL on localhost
body: <p>So I'm having an issue connecting to a mySQL database I created on my local host using XAMPP. The DB itself is set up fine on 127.0.0.1, but I had to use port 8000 (instead of 80) to get it to start in XAMPP.</p>
  
  <pre><code>  $con = mysql_connect("localhost:8000","","");
   if (!$con) {
     die('Connection failed.' . mysql_error());
   }
  </code></pre>
  
  <p>The above doesn't work, the browser times out after a few seconds saying it cannot display the webpage (note that it doesn't give the die message). I have also tried 127.0.0.1:8000 but no luck. Creating a user in phpMyAdmin and entering the credentials didn't achieve anything either.</p>
  
  <p>If I take out the port and just use: </p>
  
  <pre><code>$con = mysql_connect("localhost","","");
  </code></pre>
  
  <p>This connects, but I can't seem to select my database because I don't think it's connecting to the right server!</p>
  
  <p>Any ideas? Thank you in advance!</p>