"SET NAMES utf8") return $oPDOLink; } catch( PDOException $Exception ) { // PHP Fatal Error. Second Argument Has To Be An Integer, But PDOException::getCode Returns A // String. //throw new MyDatabaseException( $Exception->getMessage( ) , (int)$Exception->getCode( ) ); throw $Exception->getMessage(); } } public function updateUserDB($file){ $oPDOLink = $this->databaseConnect(); $sql = " SELECT db_host, db_name, db_user, db_password FROM user_detail WHERE db_host IS NOT NULL AND db_name IS NOT NULL AND db_user IS NOT NULL AND db_password IS NOT NULL ; "; $execSQL = $oPDOLink->prepare($sql); $execSQL->execute(array()); $rows = $execSQL->fetchAll(PDO::FETCH_ASSOC); foreach($rows as $row){ $oPDOUser = $this->_connectUserDB($row['db_host'], $row['db_name'], $row['db_user'], $row['db_password']); //$sql = file_get_contents(ClassConfig::getURLRoot('apps/install/'.$file['form_udpateUsersDB_file']['name'])); $sql = file_get_contents($file['form_udpateUsersDB_file']['tmp_name']); $oPDOUser->exec($sql); } //TODO import data //$oPDOPrivate = new PDO("pgsql:host=localhost;dbname=".$db_name.";user=wefra;password=wefra"); //$oPDOPrivate = new PDO("pgsql:host=localhost;dbname=".$db_name.";user=businessuseonly;password=1nrl5f6cug8n"); // PROD //$oPDOUser = new PDO("pgsql:host=localhost;dbname=businessuseonly_testimportfromsql;user=businessuseonly;password=1nrl5f6cug8n"); // return true; } }