如何整合Codeigniter 2.0.3和Adodb?
答案 0 :(得分:0)
尝试此示例(使用MSSQL数据库完成,但将其调整为数据库):
使用以下内容连接:
include('path/to/adodb/library/adodb/adodb.inc.php');
$db =& ADONewConnection('odbc_mssql');
$dsn = "Driver={SQL Server};Server=localhost;Database=XXXX_dev;";
$db->Connect($dsn,'username','password');
$rs = $db->Execute('select * from table_name');
while (!$rs->EOF) {
echo "loop: " . $rs->fields[5] . "<br>";
$rs->MoveNext();
}
$rs->Close();
$rs->Close();
您还可以查看this solution