title: Is my hosting company messing me up here: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)?
body: <p>I use the hosting company aPlus.net, and I can't seem to get past a connection error I'm getting when trying to process some php to write database content to a webpage, and I am curious as to if this is because my database appears to not be on the same server as the entire rest of my hosting account, and if there is a way to resolve this in my code? This is my first attempt at writing PHP, and it would be good to know if my code is wrong, or if my hosting company is messing me up. (and either way, how to fix it)</p>
  
  <p>Here's the code that's failing to pull from the database:</p>
  
  <pre><code>{
    $con = mysql_connect("localhost","2p5dq9vxmy240651","MY_PASSWORD");
    if (!$con)
    {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("felineasthma_2p5dq9vxmy240651", $con);
    $users_name = $_POST['name'];
    $users_comment = $_POST['requests'];
    $users_name = mysql_real_escape_string($users_name);
    $users_comment = mysql_real_escape_string($users_comment);
    $inputid = $_GET['id'];
    $query = "
    INSERT INTO `felineasthma_2p5dq9vxmy240651`.`submissions` (`id`,
     `name`, `requests`, `inputid`) VALUES (NULL, 
     '$users_name', '$users_comment', '$inputid');";
    mysql_query($query);
    echo "&lt;h2&gt;Your request has been processed, reload page.&lt;/h2&gt;";
    mysql_close($con);
  }
  </code></pre>
  
  <p>and here's some screen captures from inside my hosting account (links because I don't have enough posts here yet to upload images, sorry):</p>
  
  <p><a href="https://i.stack.imgur.com/pBvlq.png" rel="nofollow noreferrer">felineasthma_2p5dq9vxmy240651 doesn't appear in my hosting account</a></p>
  
  <p><a href="https://i.stack.imgur.com/O3TJr.png" rel="nofollow noreferrer">yet it clearly exists in MySQL Manager, but on a different server</a></p>
  
  <p>I was even more confused while making the user for this database, as the control panel didn't allow me to make a username, it just randomly assigned one. Help? Advice?</p>