Results 1 to 4 of 4

Thread: Looking for plugin/module to view external databases

  1. #1
    jsherk is offline Senior Member
    Join Date
    Sep 2009
    Posts
    21

    Default Looking for plugin/module to view external databases

    Does anybody know if there is a plugin/module available that would allow you to view a database outside of the sugarcrm database (Using CE 5.2)?

    I would like to be able to view data in another database on the same server (maybe on external servers in the future). Possibly would also like to import viewed data into SugarCRM database as well.

    Any suggestions?

    Thanks

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Looking for plugin/module to view external databases

    Which database is that? Oracle, MS SQL, MySQL:
    What is the Operating System where Sugar is installed?

    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    jsherk is offline Senior Member
    Join Date
    Sep 2009
    Posts
    21

    Default Re: Looking for plugin/module to view external databases

    DB is MySQL
    OS is Linux (one on Ubuntu and one of Centos)

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Looking for plugin/module to view external databases

    You can use such function to create an instance database through SugarCRM tiself:

    PHP Code:
    function get_db($config) {
        if(
    $config['db_type'] == "mysql") {
            
    $my_db_manager = (function_exists('mysqli_connect')) ? 'MysqliManager' 'MysqlManager';
        } else if(
    $config['db_type'] == "oci8") {
            
    $my_db_manager 'OracleManager';
        } elseif(
    $config['db_type'] == "mssql") {
            
    $my_db_manager = (is_freetds()) ? 'FreeTDSManager' 'MssqlManager';
        }

        require_once(
    "include/database/{$my_db_manager}.php");

        
    $db = new $my_db_manager();
        
    $db->getHelper();
        
    $db->connect($configtrue);

        return 
    $db;

    The $config array should looks like that:
    PHP Code:
            $config = array(
                
    'db_type' => $website_database_defs['dbtype'],
                
    'db_host_name' => $website_database_defs['hostname'],
                
    'db_user_name' => $website_database_defs['username'],
                
    'db_password' => $website_database_defs['password'],
                
    'db_name' => $website_database_defs['database'],
            ); 
    After creating an instance you can invoke all regular methods on default $db variable.

    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. enhanced studio and external databases
    By mapi33 in forum Developer Help
    Replies: 5
    Last Post: 2009-06-27, 12:59 PM
  2. Replies: 3
    Last Post: 2008-12-27, 04:51 PM
  3. Getting external data from the Case module
    By username2345 in forum Developer Help
    Replies: 10
    Last Post: 2008-08-26, 07:50 PM
  4. zuckerreports & external databases
    By HenrikE in forum General Discussion
    Replies: 0
    Last Post: 2006-09-15, 07:19 AM
  5. Read-only calendar view for external use?
    By cenforsberg in forum Help
    Replies: 0
    Last Post: 2006-08-16, 11:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •