title: PHP remote login to mysql db: "cannot select db"
body: <pre><code>&lt;?php
  error_reporting(E_ALL);
  ini_set('display_errors', '1');
  
  
  $host="host.org"; // Host name 
  $username="myServer_guest"; // Mysql username 
  $password="password"; // Mysql password 
  $db_name="myServer_JMblog"; // Database name 
  $tbl_name="blog"; // Table name
  
  // Connect to server and select databse.
  $link=mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
  echo $link.'&lt;br&gt;';
  
  
  mysql_select_db("$db_name")or die("cannot select DB");
  ?&gt;
  </code></pre>
  
  <p>I am getting a successful connection, but now I cannot select the db. All login credentials are correct. Any help would be amazing.</p>