Welcome Guest, Not a member yet? Register   Sign In
Can some one help me with this database connectiong issue
#4

[eluser]PravinS[/eluser]
you can save the group name in database, so you last two function get_db_lst and connectDb will be like this

Code:
function get_db_lst($srv_cred)
{
  foreach ($srv_cred as $key => $value)
  {
   $ip_add = $value['ip_add'];
   $uname=$value['sql_uname'];
   $pswd =$value['pswd'];
   $group = $value['pswd'];
  }
  $this->connectDb($group,$ip_add,$uname,$pswd);
}
        

// trying to connect to that database    
            function connectDb($group,$ip_add,$uname,$pswd)
            {
                $db[$group]['hostname'] = $ip_add;
                $db[$group]['username'] = $uname;
                $db[$group]['password'] = $pswd;
                $db[$group]['database'] = "CARDZME";
                $db[$group]['dbdriver'] = "mysql";
                $db[$group]['dbprefix'] = "";
                $db[$group]['pconnect'] = TRUE;
                $db[$group]['db_debug'] = TRUE;
                $db[$group]['cache_on'] = FALSE;
                $db[$group]['cachedir'] = "";
                $db[$group]['char_set'] = "utf8";
                $db[$group]['dbcollat'] = "utf8_general_ci";
               $this->otherdb =  $this->load->database($group, TRUE);
               print_r($this->otherdb);
              
            }


Messages In This Thread
Can some one help me with this database connectiong issue - by El Forum - 08-31-2013, 12:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB