php连接数据库 需要下载adodb
<?
include('adodb/ADOdb.inc.php'); # 加载ADODB
$conn = &ADONewConnection('odbc_mssql'); # 建立一个连结
$conn->PConnect('Driver={SQL Server Native Client 10.0};Server=asd;Database=ITL-kehu;','sa','123','ITL_Helpdesk_Test') or die('asdfsaf'); # 连结到 MS-Access 北风数据库
$recordSet = &$conn->Execute('select * from zentrack_users');
if (!$recordSet)
print $conn->ErrorMsg();
else
print_r($recordSet);
/*while (!$recordSet->EOF) {
print $recordSet->fields[0].' '.$recordSet->fields[1].'<BR>';
$recordSet->MoveNext();
}*/
$recordSet->Close(); # 选择性执行
$conn->Close(); # 选择性执行
?>