Location: PHPKode > projects > KSMS bulk sms manager > ksms-e1.2.35/plugin/gateway/connection.inc
<?php
// Include the ADODB library.
require("../../adodb/adodb.inc.php");
// Connect to the database.
$db = &ADONewConnection($cfg["db_type"]);
if ($cfg["db_persist"] == TRUE) { // Persistant DB connection.
   switch ($cfg["db_type"]) {
      case "sqlite":
         $db->PConnect($cfg["db_host"]);
         break;
      case "access":
      case "odbc":
         $db->PConnect($cfg["db_host"], $cfg["uid"], $cfg["pwd"]);
         break;
      default:
         $db->PConnect($cfg["db_host"], $cfg["uid"], $cfg["pwd"], $cfg["db"]);
   }
} else { // Non-persistent DB connection.
   switch ($cfg["db_type"]) {
      case "sqlite":
         $db->Connect($cfg["db_host"]);
         break;
      case "access":
      case "odbc":
         $db->Connect($cfg["db_host"], $cfg["uid"], $cfg["pwd"]);
         break;
      default:
         $db->Connect($cfg["db_host"], $cfg["uid"], $cfg["pwd"], $cfg["db"]);
   }
}
// For debugging
// require("../../adodb/tohtml.inc.php");
// $db->debug = TRUE;
?>
Return current item: KSMS bulk sms manager