title: connection to db4free with php
body: <p>i'm new here and doing some project,</p>
  
  <p>how can i connect to my database in db4free.net from php,
  i have tried this</p>
  
  <pre><code>&lt;?php
  
  $host = "db4free.net/mainbookstore";
  $user = "***";
  $pass = "****";
  $database = "mainbookstore";
  
  $conn = mysql_connect($host, $user, $pass);
  if ($conn) {
  $buka = mysql_select_db ($database);
  if (!$buka) {
  die ("Database tidak dapat dibuka");
  }
  } else {
  die ("Server MySQL tidak terhubung"); 
  }
  
  ?&gt;
  </code></pre>
  
  <p>but get error Such no host, but in my java use :</p>
  
  <pre><code>dataSource.setUrl("jdbc:mysql://db4free.net:3306/mainbookstore");
  </code></pre>
  
  <p>i can connect to my database.
  Thanks before :)</p>