Codeigniter 2.0.3 and Adodb Integration/Installation
How do you integrate Codeigniter 2.0.3 开发者_StackOverflow社区and Adodb?
try this example (done with a MSSQL db, but adjust it to your db) :
- download the ADOdb library from :
http://www.ciforge.com/trac/adodb/ or http://adodb.sourceforge.net/#download - Unzip the library to someplace on your server which can be called from your php pages
Connect using something like this:
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();
you may also take a look at this solution
精彩评论