PDO To Connect to MSSQL Over MSSQL_* Functions

后端 未结 4 2270
耶瑟儿~
耶瑟儿~ 2020-12-11 03:23

There is a range of mssql_* Which are not in the depreciation process.

They work the same as mysql_* functions; they need to me manually es

4条回答
  •  难免孤独
    2020-12-11 03:54

    This could spark up a good debate. I guess the only way to test the stability of the PDO functions towards Microsoft SQL Servers, is to setup your own local testing zone and push the PDO Class to its abilities.

    As you said, php5-sybase contains MSSQL Functions and are not in the deprecation process.

    I guess it's down to what the developer feels comfortable with.

    If you're happy with MSSQL_* Functions, then go ahead and use them, but there could be a possibility they will end up getting deprecated from PHP altogether in the near future -- it's happening with MySQL Functions.

    Although, if you're looking for a change and new challenges, with added security from SQL Injection, then go ahead and try out the PDO compatibility with MSSQL Servers.

    It's entirely down to you.

    From my preference & and guess many other developers preference, I would say go for the PDO functions. I assume it would work as normal.

    getMessage();
    }
    
    $Query = $dbh->prepare("SELECT * FROM Tbl WHERE `ID` = :id");
    $Query ->bindParam(':id', $ID, PDO::PARAM_INT);
    $Query->execute();
    
    // etc..
    ?>
    

提交回复
热议问题