Retrieve data from database
Posted: Thu Jul 17, 2008 5:18 pm
Hi!
How do I retrieve data from a table in Joomla 1.5 without using MCV?
Thank you!
How do I retrieve data from a table in Joomla 1.5 without using MCV?
Thank you!
Joomla! Community, help and support.
https://forum.joomla.org/
Code: Select all
$db = JFactory::getDBO();
$query = "SELECT content_id"
. " FROM #__content_frontpage"
. " WHERE content_id = $item_id"
. " LIMIT 1"
;
$db->setQuery($query);
$rows = $db->loadObjectList();
$itemrow = $rows[0];
$on_frontpage = $itemrow->content_id;
er...My second question is: what do these lines mean?
Code: Select all
$db = JFactory::getDBO();
Code: Select all
$query = "SELECT content_id"
. " FROM #__content_frontpage"
. " WHERE content_id = $item_id"
. " LIMIT 1"
;
Code: Select all
$db->setQuery($query);
Code: Select all
$rows = $db->loadObjectList();
Code: Select all
$itemrow = $rows[0];
Code: Select all
$on_frontpage = $itemrow->content_id;
sorry, don't know. maybe you should test that.does the DB instance...work with PostgreSQL too