????????????????4?????裬1???????????2????????????3???????????????????4??????????
????php????mssql??????м??????????????mssql?????汾??32λ??64λ????????
?????????php.ini?????;extension=php_pdo_mssql.dll ;extension=php_pdo_odbc.dll ??????????????????????????mssql??????????????????Ч??
???????????????
????1??odbc
???????????php??????????????????odbc??????32λ??64λ????????????32λ??????????й???????е????????odbc???????????????64λ???????C:WindowsSysWOW64odbcad32.exe
???????????????á????????????????????????32????????????÷??????32λ??64λ?????????????????????????????????λ????oá?
??????????odbc???????????
????$con = odbc_connect('odbc????'??'?????'??'????');
????2??????mssql2000
????$con = mssql_connect('???????'??'?????'??'????');
????3??????mssql2008
????$connectionInfo =  array("UID"=>???????"PWD"=>????"Database"=>"?????????");
????$con = sqlsrv_connect( ?????????$connectionInfo);
??????????????????
?????????????????????д????????mssql??????ú???????????????????sql??丳????????????
???????????????
????$query = "SELECT top 12 * ????????? order by id desc";
????????????????????????
????1??odbc
????$result = odbc_do($con??$query);
????while(odbc_fetch_row($result))
????{
????$???????? = odbc_result($result?? "???????");
????}
????2??????mssql2000
????$result = mssql_query($con?? $query);
????while($row =mssql_fetch_array($result))
????{
????$???????? = $row["???????"];
????}
????3??????mssql2008
????$result = sqlsrv_query($con?? $query);
????while($row = sqlsrv_fetch_array($result))
????{
????$???????? = $row["???????"];
????}
??????php5.3??????汾?в?????sqlsrv????????????????????????
??????????????
?????????????????????odbc_close();??mssql_close()??sqlsrv_close();
?????????php????mssql??????mssql??????????Щ?????????????????庯??????ο?php?????????oschina??php?????????