Joomla has a default script to retrieve content from a sql table.
Here's the article (#__ content)
Get article id:
$articleId = (JRequest::getVar('option')==='com_content' && JRequest::getVar('view')==='article')? JRequest::getInt('id') : 0;
To get the content of an article:
$table_plan = & JTable::getInstance('Content', 'JTable'); $table_plan_return = $table_plan->load(array('id'=>$articleId)); echo "<pre>";print_r($table_plan->introtext);echo "</pre>";
Kathir
source share