Advertisement
uzielweb

Select Client Banners if Exists banner for this client

Dec 19th, 2017
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. $db = JFactory::getDbo();
  2. $query = $db->getQuery(true);
  3. $query->select('a.*');
  4. $query->from($db->quoteName('#__banner_clients', 'a'))
  5.     ->join('INNER', $db->quoteName('#__banners', 'b') . ' ON (' . $db->quoteName('b.cid') . ' = ' . $db->quoteName('a.id') . ')')
  6.     ->order($db->quoteName('a.name') . 'ASC');
  7. $db->setQuery($query);
  8. $results = $db->loadObjectList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement