开发者

Codeigniter 2.0.3 and Adodb Integration/Installation

开发者 https://www.devze.com 2023-04-01 10:44 出处:网络
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) :

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) :

  1. download the ADOdb library from :
    http://www.ciforge.com/trac/adodb/ or http://adodb.sourceforge.net/#download
  2. Unzip the library to someplace on your server which can be called from your php pages
  3. 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

0

精彩评论

暂无评论...
验证码 换一张
取 消