Skip to content

Instantly share code, notes, and snippets.

@araneta
Created May 11, 2014 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save araneta/2570f66422af7b1197b8 to your computer and use it in GitHub Desktop.
Save araneta/2570f66422af7b1197b8 to your computer and use it in GitHub Desktop.
Joomla: get article by article id
$db = &JFactory::getDBO();
$sql = "SELECT introtext FROM #__content WHERE id = ".intval($articleId);
$db->setQuery($sql);
$fullArticle = $db->loadResult();
if(!strlen(trim($fullArticle)))
  $fullArticle = "Article is empty ";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment