• Hi to everybody and tks in advance for your help. I’m trying to develop a plugin that take some info of a SQL Server Database to manage that info and then saved it on wordpress database. I was surfing and found that in PHP you can use a function call “sqlsrv_connect” but when I tried to use it I get an 500 Internal Server Error in my plugin. Anyone had used this function or something like this before? It is possible? Thanks!!!
    This is the code I’m trying:

    echo  '<p>PREPARING CONNECTION...</p>';
    $serverName = "<SERVERNAME\instanceName>, <PORTNUMBER>";
    $connectionInfo = array( "Database"=>"DBNAME", "UID"=>"USER", "PWD"=>"PASS");
    echo  '<p>CONNECTING...</p>';
    $conn = sqlsrv_connect( $serverName, $connectionInfo);
    if( $conn ) {
        echo  '<p>CONNECTION OK!</p>';
    }else{
        echo  '<p>CONNECTION FAILED!</p>';
        die( print_r( sqlsrv_errors(), true));
    }

The topic ‘Using sqlsrv_connect’ is closed to new replies.