title: accessing mysql using different server to which db connection data is located
body: <p>I'm trying to include a file with all my db connection info (hostname password username).</p>
  
  <p>this is what i have so far:</p>
  
  <pre><code>include ('http://site.com/config35sdf322e54353452d/wp2154654315634652132513546541564.php');
  
  mysql_connect($hostname,$username,$password);
  @mysql_select_db($dbname) or die( "Unable to select database");
  
  include ('../refference.php');
  $select = mysql_query("SELECT my_field FROM $usertable WHERE ".
  "GDI_Username = '$sponsor_GDI_id' AND Unique_id = '$sponsor_refference'");
  
  
  while($check = mysql_fetch_array($select)) {
      $sponsor_email = $check["email"];
      $sponsor = $check["GDI_Username"];
      $sponsor_first_nme = $check["First_Name"];
      $sponsor_second_nme = $check["Last_name"];
      $sponsor_domain = $check["GDI_Domain"];
      $unq_id = $check["Unique_id"];
   } 
  
  $sponsor_name = "$sponsor_first_nme $sponsor_second_nme";
  
  echo "$sponsor $hostname" ?&gt;
  </code></pre>
  
  <p>I get an error saying it cant select db ("unable to select database")</p>
  
  <p>after some investigating (with the echo statement at the end of the code), it seems to be having issues including the .php file on a different server error code:<code>include ('http://site.com/config35sdf322e54353452d/wp2154654315634652132513546541564.php');</code></p>
  
  <p>Any clues?</p>
  
  <p>Thanks</p>