Coding problem ... can you take a look?
Posted: Mon Mar 17, 2008 6:16 pm
Hi,
I'm migrating my Joomla modules to support Joomla 1.5 natively. I'm not an experienced php / Joomla coder, though I've programmed web applications in various languages. I've nearly completed my first one, but I'm having problems accessing the database for some reason. Not sure if I have incorrect syntax or what might be wrong. Is there something wrong with the following code. Its always returning false.
I'm migrating my Joomla modules to support Joomla 1.5 natively. I'm not an experienced php / Joomla coder, though I've programmed web applications in various languages. I've nearly completed my first one, but I'm having problems accessing the database for some reason. Not sure if I have incorrect syntax or what might be wrong. Is there something wrong with the following code. Its always returning false.
Code: Select all
function &getItems(&$params)
{
$db =& JFactory::getDBO();
$ids = trim( $params->get('ids') );
//$sql = 'SELECT id, title FROM '.$db->nameQuote('#__content').' WHERE id in '.$ids;
$sql = 'SELECT id, title FROM #__content WHERE id in '.$ids;
echo JText::_($sql);
if ($instance = $db->loadObjectList())
{
return $instance;
}
else
{
return false;
}
}