Skip to content

Instantly share code, notes, and snippets.

@gartes
Last active May 9, 2018 14:15
Show Gist options
  • Save gartes/cfdf966217a4be71b70065b81a9e02bd to your computer and use it in GitHub Desktop.
Save gartes/cfdf966217a4be71b70065b81a9e02bd to your computer and use it in GitHub Desktop.
JFactory::getDBO
$db = JFactory::getDBO ();
$query = $db->getQuery(true);
// ....
try {
// echo $query->dump();
$db->setQuery($query);
$result = $db->loadResult();
}catch (Exception $e){
$mes = $e->getMessage() . "\n\r" ;
$mes .= 'File:' . __FILE__ . "\n\r" ;
$mes .= 'Line: '.__LINE__ . "\n\r" ;
JFactory::getApplication()->enqueueMessage( $mes , 'error');
}
@gartes
Copy link
Author

gartes commented Apr 30, 2018

1321321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment