I can use this to get published articles from the database:
function queryDatabase_Posts($select, $limit) {
// Database connection and query object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Select.
$query->select($select);
$query->from($db->quoteName('#__content'));
// Published posts only.
$query->where($db->quoteName('state') . ' = 1');
// Order by the date they are published.
$query->order('publish_up DESC');
// Set and fetch.
$db->setQuery($query);
return $db->loadAssocList();
}
but according to this overview of the #__content
table tags are apparently kept in a different table.
How can I query that table? What is it called, what's inside? Is there documentation on that?
Ultimately I want to query the database for posts that have a certain tag of which I have the name. So I would need to query the tag table for the ID.