Skip to content

Instantly share code, notes, and snippets.

@maranemil
Last active August 29, 2015 14:18
Show Gist options
  • Save maranemil/2bd059ca20e8db8c8ce7 to your computer and use it in GitHub Desktop.
Save maranemil/2bd059ca20e8db8c8ce7 to your computer and use it in GitHub Desktop.
Using DB in SugarCRM
global $db;
$db = DBManagerFactory::getInstance();
$sql = "SELECT your_qurey_here";
$res = $db->query($sql);
$row = $db->fetchByAssoc($res);
$cnt = $db->getRowCount($res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment