मुझे मास्टर डेटाबेस से एक MySQL डेटाबेस जानकारी पुनर्प्राप्त करना है और फिर उस डेटाबेस से कनेक्ट करना है, और कुछ रिकॉर्ड प्राप्त करना है।कोडनिर्देशक - एकाधिक डेटाबेस कनेक्शन
मेरा मतलब है कि एक डेटाबेस धारण करना मैं एक और डेटाबेस लोड करना चाहता हूं।
क्या यह कोडनिर्देशक के साथ संभव है? अभी मैं अपने मॉडल में कोड की निम्नलिखित पंक्तियों का उपयोग कर रहा हूं।
function connectDb($credential)
{
$config['hostname'] = $credential['server'];
$config['username'] = $credential['username'];
$config['password'] = $credential['password'];
$config['database'] = $credential['database'];
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = "";
$config['char_set'] = "utf8";
$config['dbcollat'] = "utf8_general_ci";
$DB2=$this->load->database($config);
$DB2->db->select('first_name,last_name');
$query = $DB2->db->get('person');
print_r($query);
}
यह काम नहीं कर रहा है क्या कोई और तरीका है?
परिभाषित करें "काम नहीं कर रहा" –