Welcome Guest, Not a member yet? Register   Sign In
Dynamic database selection
#1

[eluser]cpass78[/eluser]
Hello,

I have a need to connect to many databases from a form to check if certain tables exist. There could potentially be hundreds of DB's and the names are not known yet. I'd need to connect to one based on
Code:
$this->input->post();
value.

Is there any way to do this without messing with the database.php config file? My username password and host would all remain the same just the db would need to change.

I did try
Code:
$config['database'] = "study_".$this->studycode;
        if ($this->load->database($config)){
            echo "true";
        }else{
            echo "false";
        }
and it always returns false, but the post vale is correct.

Thank you!


Messages In This Thread
Dynamic database selection - by El Forum - 12-01-2010, 12:02 PM
Dynamic database selection - by El Forum - 12-01-2010, 12:31 PM
Dynamic database selection - by El Forum - 12-01-2010, 12:45 PM
Dynamic database selection - by El Forum - 12-01-2010, 03:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB