• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    mssql_connect() Unable to connect to server to Remote host from php hosting

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 2.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fuzhiwara
      last edited by tomas_hora

      I have working mssql connecting codes and them working in my another company php host but dont work when i moved new host. All codes same i dont know why connect from new host ? In new host using cpanel and php ( asphostportal) and im looking php.ini in cpanel mssql settings looking good. my codes below under

      $usernameb ="myuser";
      $passwordb = "mypass";
      $databaseb = "mydb";
      $host ="myhostip"
      
      $connection = mssql_connect($host, $usernameb, $passwordb);
      if (!$connection) {  die('Not connected : ' . mssql_get_last_message());} 
      
      
      $db_selected = mssql_select_db($databaseb, $connection);
      if (!$db_selected) {
        die ('Can\'t use db : ' . mssql_get_last_message());
      } else{
      
      
      }
      

      And gives that error on my new hosting

      Warning: mssql_connect(): Unable to connect to server: ip here in
      

      Any idea ?

      1 Reply Last reply
      Reply Quote 0
      • T
        tomas_hora administrators
        last edited by

        You are missing ; at the end of

        $host ="myhostip"
        
        1 Reply Last reply
        Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post