2017-05-23 5 views
0

드루팔 (8)에 연결 모듈을 만들려면 어떻게해야합니까 : 나는 (phpMyAdmin을에 위치) 외부 데이터베이스에 연결하는 양식 모듈을 만드는 방법에 대해 이동하는 방법에 대해 궁금 해서요, 오히려 이상을 Drupal 8 데이터베이스. 나는 드루팔 (Drupal)에 대해 오히려 새로운 편이며, 저에게 효과적 일 수있는 그러한 예를 찾을 수 없었습니다.당신은 드루팔 양식 외부 데이터베이스

도움을 주시면 감사하겠습니다. 이 질문은 매우 드루팔 (Drupal) 8 특정합니다. 모듈 파일에서 settings.php

$databases = array(); 
$databases['default']['default'] = array(
    // Drupal's default credentials here. 
    // This is where the Drupal core will store its data. 
); 
$databases['my_other_db']['default'] = array(
// Your secondary database's credentials here. 
// You will be able to explicitly connect to this database from you 
    modules. 
); 

에서

+0

가능한 복제 [삽입하여 DB에 형태의 컨텐츠를 제출 드루팔 \ _write \ _record] (https://stackoverflow.com/question/12317031/insert-submitted-form-content-to-db-using-drupal-write-record) – Picard

+0

내 질문은 Drupal 8과 내가 이전에 다른 질문에 대해 한 독서와 중복되지 않습니다. 버전, 변경하기 전에. – Jay1995

답변

1

db_set_active('my_other_db'); 
    // Run queries 
    // Change back to your DB 
    db_set_active();