0
我想從RSEvents的joomla數據庫中獲取類別詳細信息。任何人都可以解釋爲什麼這不起作用:從Joomla數據庫獲取RS Eevents類別名稱
function _getCategorySlug($value) {
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select all articles for users who have a username which starts with 'a'.
// Order it by the created date.
// Note by putting 'a' as a second parameter will generate `#__content` AS `a`
$query
->select($db->quoteName(array('a.*', 'b.id', 'b.ide')))
->from($db->quoteName('#__categories', 'a'))
->join('INNER', $db->quoteName('#__rseventspro_taxonomy', 'b')
. ' ON (' . $db->quoteName('a.id') . ' = ' . $db->quoteName('b.id') . ')')
->where($db->quoteName('b.ide') . ' = '.$db->quote($value));
// Reset the query using our newly populated query object.
$db->setQuery($query);
// Load the results as a list of stdClass objects (see later for more options on retrieving data).
$results = $db->loadObjectList();
}
你在哪裏調用函數?還要確保你在函數末尾返回一些東西 – Lodder
oops忘了返回結果! 雖然沒有幫助,但這是_getCategorySlug($ event-> id)返回的內容: '未知列'a'*'in'field list'SQL = SELECT'a'.'''''''''' .''''''' FROM'db_categories' as'a' INNER JOIN'db_rseventspro_taxonomy' as'b' ON('a'.'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''') '.'''' ='41'' – Bulletproof