title: Access remote database MySQL via PHP
body: <p>I have a MySQL database set up on 000webhost.com. I want to access the data in my database via PHP. I tried:</p>
  
  <pre><code>&lt;?php 
  
  include("connect.php");
  mysql_select_db("XXXXXXX_users", $con) or die(mysql_error()); 
  
  $result = mysql_query("SELECT * FROM data ORDER BY id DESC");
  while($row = mysql_fetch_array($result))     
  {
      $id = $row['id'];
      $user = $row['usrname'];
  } 
  
  
  echo "$user";
  ?&gt;
  </code></pre>
  
  <p>But it always returns as: "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond." </p>
  
  <p>What do I do? </p>
  
  <ul>
  <li>I do not have root access</li>
  <li>I'm trying to run the script on Apache</li>
  </ul>