function db_tables() { $db = JFactory::getDBO(); $con_type = JRequest::getVar('con_type'); if ($con_type == 'local') { $query = "SHOW TABLES"; $db->setQuery($query); $tables = $db->loadColumn(); } if ($con_type == 'remote') { $remote = array(); $remote['driver'] = 'mysql'; $remote['host'] = JRequest::getVar('host'); $remote['user'] = JRequest::getVar('username'); $remote['password'] = JRequest::getVar('password'); $remote['database'] = JRequest::getVar('database'); $remote['prefix'] = ''; $db = JDatabase::getInstance($remote); if ($remote['host'] == "") { echo '1'; return false; } try { $query = "SHOW TABLES"; $db->setQuery($query); $tables = $db->loadColumn(); } catch (RuntimeException $e) { echo 1; return false; } } HTML_contact::db_tables($tables); }