title: Can't connect using mysqli_connect, but mysql_connect works..?
body: <p>I got the credentials for connecting to MySQL directly from my hosting provider (1and1). However, when I try to connect with the following code:
      
  
  <pre><code>$db_hostname = 'localhost/tmp/mysql5.sock';
  $db_database = 'db543062602';
  $db_username = '***********';
  $db_password = '***********';
  
  $dbc = mysqli_connect($db_hostname, $db_username, $db_password, $db_database)
      or die('Error connecting to MySQL server');
  ?&gt;
  </code></pre>
  
  <p>ERROR:</p>
  
  <blockquote>
    <p>Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host
    'localhost/tmp/mysql5.sock' (1) in /homepages/... ... ... /purge.php
    on line 10 Error connecting to MySQL server</p>
  </blockquote>
  
  <p>The credentials are all the same. In fact, it works when connecting using mysql_connect(), but it doesn't want to work with mysql_connect()! Any thoughts on what could be causing the problem?</p>