Loading ...
Sorry, an error occurred while loading the content.

Help needed with database connections

Expand Messages
  • Rahat Bashir
    Dear Experts, I am stacked with some difficulties regarding Database connection; following is the scenario: I have two domains: 1) myfirstdomain.com.bd and 2)
    Message 1 of 1 , Sep 7 9:51 PM
    • 0 Attachment
      Dear Experts, I am stacked with some difficulties regarding Database connection; following is the scenario:

      I have two domains: 1) myfirstdomain.com.bd and
                                    2) myseconddomain.com.bd

      I want to connect the database and pick some data from myseconddomain.com.bd

      what I have done is:
      a) In the myseconddomain.com.bd: going to "Remote MySQL" option in cPanel added a host %.myfirstdomain.com.bd and %
      b) Tried to connect from myfirstdomain.com.bd with the following script puting the script file in the public_html directory:

      $con = mysqli_connect('www.myseconddomain.com.bd', 'database user name', 'password');
      if(!$con){
          die('Could not connect with to database: '.  mysqli_error($con));
      } else {
          echo('Connecton established!!');
          mysqli_close($con);
      }

      what I have got is:

      Request Timeout

      This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'

      My question:
      whats happening there? why it is taking so long? do I need to configure any other thing? How can I establish the connection???


      Rahat Bashir


    Your message has been successfully submitted and would be delivered to recipients shortly.