Skip to content

Instantly share code, notes, and snippets.

@esedic
Created July 4, 2014 14:39
Show Gist options
  • Save esedic/f2964525709bdb228bd6 to your computer and use it in GitHub Desktop.
Save esedic/f2964525709bdb228bd6 to your computer and use it in GitHub Desktop.
Joomla DB Query
<?php
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query
->select($db->quoteName(array('a.id')))
->from($db->quoteName('#__content', 'a'))
->join('INNER', $db->quoteName('#__categories', 'b') . ' ON (' . $db->quoteName('b.id') . ' = 38)');//static category id
$db->setQuery($query);
$results = $db->loadObjectList();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment