Magento에 문제가 있습니다. 나는 magento.one 데이터베이스와 두 데이터베이스를 연결하고 싶습니다 메인 데이터베이스와 다른 가게 될 것입니다. 나는 이 거짓 도와주세요 내 local.xml입니다 ..... it.By 내 연결이 파일 응용 프로그램은/etc/local.xml에이 시간을 어떻게 해야할지 다음과 해달라고 [mysql4]> 두 데이터베이스에 magento 연결
3
A
답변
2
내가 구현 한보다 우아한 해결책이 있지만 내 방법이 효과적 일 수 있습니다. osCommerce 가져 오기/내보내기 모듈에서이 작업을 수행했습니다.
/httpdocs/app/etc/config.xml이 당신에게 당신의 모델 내에서 oscommercedb
를 호출 할 수있는 기능을 제공
<!-- osCommerce db/read/write -->
<oscommercedb>
<connection>
<host>localhost</host>
<username>root</username>
<password>pass</password>
<dbname>oscommerce_database_name</dbname>
<model>mysql4</model>
<initstatements>SET NAMES utf8</initstatements>
<type>pdo_mysql</type>
<active>1</active>
</connection>
</oscommercedb>
<oscommercedb_write>
<connection>
<use>oscommercedb</use>
</connection>
</oscommercedb_write>
<oscommercedb_read>
<connection>
<use>oscommercedb</use>
</connection>
</oscommercedb_read>
<!-- end osCommerce db -->
. 위의 코드는 <resources>
블록 안에 있습니다.
이제 모델을 살펴 보겠습니다. /httpdocs/app/code/local/Company/Extension/Model/OsCustomers.php
class Company_Extension_Model_OsCustomers extends Mage_Core_Model_Abstract
{
protected $_name = 'customers'; // name of the table
/**
* Returns rowset of tables for customers
*
* @return Zend_Db_Table_Rowset
*/
public function getAllOscommerceCustomers()
{
$read = Mage::getSingleton('core/resource')->getConnection('oscommercedb');
$stmt = $read->select();
$stmt->from(array('c' => 'customers'))
->join(array('a' => 'address_book'), 'a.address_book_id = c.customers_default_address_id')
->joinLeft('zones', 'zones.zone_id = a.entry_zone_id')
->join('countries','a.entry_country_id = countries.countries_id', array('countries_iso_code_2'));
return $read->fetchAll($stmt);
}
특정 문제가 발생하는 경우
은 알려주세요.
+0
도움을 주셔서 대단히 감사합니다. 코드를 사용하여 매우 쉽게 할 수있었습니다. –
+0
감사합니다. 좋은 일을 계속 지키라. –
관련 문제
- 1. 두 데이터베이스에 연결
- 2. 두 데이터베이스에 연결
- 3. django 데이터베이스에 두 번 연결
- 4. 동일한 데이터베이스에 두 개의 데이터 소스 연결
- 5. Playframework 독립형 작업이 데이터베이스에 연결 두 번
- 6. FB 연결 및 magento
- 7. Magento 데이터베이스 연결 문제
- 8. Magento의 두 번째 db 연결
- 9. 데이터베이스에 연결
- 10. 데이터베이스에 연결
- 11. 데이터베이스에 연결
- 12. 데이터베이스에 연결
- 13. Magento API 타사 연결
- 14. Qt로 로컬 데이터베이스에 연결
- 15. 데이터베이스에 대한 SSL 연결
- 16. 여러 데이터베이스에 연결
- 17. Magento 데이터베이스에 저장된 쿠폰 코드
- 18. 조건부로 데이터베이스에 연결
- 19. PostGIS 데이터베이스에 연결
- 20. SQlite 데이터베이스에 연결
- 21. QTreeWidgetItem을 데이터베이스에 연결
- 22. 데이터베이스에 J2ME 연결
- 23. PHP에서 MySQL 데이터베이스에 연결
- 24. VB.NET에서 mysql 데이터베이스에 연결
- 25. 로컬 호스트 데이터베이스에 연결
- 26. MySQL 데이터베이스에 연결
- 27. Wampserver 데이터베이스에 연결
- 28. .Net에서 GreenPlum 데이터베이스에 연결
- 29. Python에서 MySQL 데이터베이스에 연결
- 30. ios 데이터베이스에 연결
http://blog.decryptweb.com/connect-database-magento/이 링크를 사용해보십시오 – sulabh