I have a question regarding mysql db and codeigniter framework
I want to use one query accessing multiple DBs using codeigniter which returns one resultset Example as follow:
SELECT A.name, B.class_name
FROM DB1.Table1 AS A, DB2.Table1 AS B
WHERE A.id = B.id
Return one result????
Following are my connection setting in codeigniter
$db['DB2']['hostname'] = 'localhost';
$db['DB2']['username'] = 'connection_name';
$db['DB2']['password'] = 'connection_password';
$db['DB2']['database'] = 'DB2';
$db['DB2']['dbdriver'] = 'mysql';
$db['DB2']['dbprefix'] = '';
$db['DB2']['pconnect'] = TRUE;
$db['DB2']['db_debug'] = TRUE;
$db['DB2']['cache_on'] = FALSE;
$db['DB2']['cachedir'] = '';
$db['DB2']['char_set'] = 'utf8';
$db['DB2']['dbcollat'] = 'utf8_general_ci';
$db['DB2']['swap_pre'] = '';
$db['DB2']['autoinit'] = TRUE;
$db['DB2']['stricton'] = FALSE;
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'connection_name';
$db['default']['password'] = 'connection_password';
$db['default']['database'] = 'DB1';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
Kindly provide me some sample code which helps to run the above query.
Thanks in advance