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

[eluser]tiffany1988[/eluser]
[quote author="PravinS" date="1377934736"]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);
              
            }
[/quote]

$group = $value['pswd'];

why are you storing password in that $group ??

i believe its by mistake...O.o


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



Theme © iAndrew 2016 - Forum software by © MyBB