Results 1 to 4 of 4

Thread: Connect to database in sugarCRM

  1. #1
    eecanoc is offline Junior Member
    Join Date
    Feb 2010
    Posts
    1

    Default Connect to database in sugarCRM

    hi..

    I have a doubt regarding i could connect to database in sugarCRM, i am looking an example how i can connect to sugarCRM database throught php ..

    i couldn't found anything...about it...

    Thanks for your help..

  2. #2
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Connect to database in sugarCRM

    Hello,

    Take a look at the example :

    PHP Code:
    include_once('include/database/DBManagerFactory.php');
    $db DBManagerFactory::getInstance();
    $db->query('SELECT ... FROM ... WHERE ...'); 
    Letrium ltd. - Only high quality service
    http://letrium.com

  3. #3
    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: Connect to database in sugarCRM

    Quote Originally Posted by AlexAv View Post
    Hello,

    Take a look at the example :

    PHP Code:
    include_once('include/database/DBManagerFactory.php');
    $db DBManagerFactory::getInstance();
    $db->query('SELECT ... FROM ... WHERE ...'); 
    A better approach would be:

    PHP Code:
    global $db;

    $db->query($querytrue); 
    or

    PHP Code:
    $GLOBALS['db']->query($querytrue); 
    Cheers
    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.

  4. #4
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Connect to database in sugarCRM

    Quote Originally Posted by andopes View Post
    A better approach would be:

    PHP Code:
    global $db;

    $db->query($querytrue); 
    or

    PHP Code:
    $GLOBALS['db']->query($querytrue); 
    Cheers



    Yes, it is better solution.
    Letrium ltd. - Only high quality service
    http://letrium.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need help; How to connect a live database to SugarCRM ?
    By occupied in forum Sales Force Automation
    Replies: 1
    Last Post: 2011-09-21, 02:24 PM
  2. Can Not Connect to Database
    By lcasey-va in forum Installation and Upgrade Help
    Replies: 1
    Last Post: 2009-08-22, 12:43 PM
  3. Can not connect to database
    By rus in forum Help
    Replies: 9
    Last Post: 2009-02-05, 03:15 PM
  4. Replies: 1
    Last Post: 2008-12-01, 08:56 AM
  5. connect sugarcrm to another database
    By shahrzad.khorrami in forum Developer Help
    Replies: 3
    Last Post: 2008-06-23, 07:39 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
  •