Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Wednesday, July 28th at 3pm PST / 6pm EST. Learn more
  • GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Dexter305
    New

    Connect in SQL Server database php


    Hello

    I have a "Hosting - Web - Ultimate - Windows"

    My Plesk is running PHP Version 5.6.30

    I'm trying to connect in Sql server using sqlsrv_connect or PDO

    in both I'm getting an error message


    "This extension requires the Microsoft ODBC Driver 11 for SQL Server to communicate with SQL Server"

     

    In PDO I use the connection below

    $pdo = new PDO('sqlsrv:server=xx;Database=xx', 'xx', 'xx');
    ------

     

    in sqlsrv_connect :
    $connectionInfo = array( "Database"=>"xx", "ReturnDatesAsStrings"=> true, "UID"=>"xx", "PWD"=>"xx");        
    $data = sqlsrv_connect( $serverName, $connectionInfo);   

    --------

    If I change my PHP Version to 5.4.45 in Plesk , the code works.

    0 REPLIES 0