Chris
Chris

Reputation: 1

Joomla - Independent SQL query

I'm wondering if someone can give me a bit of a hand.

I'm trying to write a query inside a PHP file in Joomla and its not really working that well, nothing is being output.

I'm very new to this Joomla stuff, so if someone could let me know where I'm going wrong that would be great.

My code is as follows:

$db =& JFactory::getDBO();
$query = "SELECT fullname FROM jos_jxzine_authors WHERE published = '1'";
$db->setQuery($query);
$column = $db->loadResultArray();

echo JHTML::_('select.options', $column, 'value', 'text', $this->categoryMap);

Cheers,

Upvotes: 0

Views: 1000

Answers (1)

Gaurav
Gaurav

Reputation: 28755

Please use this query

$query = "SELECT fullname FROM `#__jxzine_authors` WHERE published = '1'";

joomla will itself add db prefix. So you must use #_ instead of jos

Upvotes: 1

Related Questions