I want to get article text by passing article ID from the joomla template.
Joomla has the default script for getting content from sql table.
Here article (#__content)
To Get Article Id:
$articleId = (JRequest::getVar('option')==='com_content' && JRequest::getVar('view')==='article')? JRequest::getInt('id') : 0;
To get Article content:
$table_plan = & JTable::getInstance('Content', 'JTable');
$table_plan_return = $table_plan->load(array('id'=>$articleId));
echo "";print_r($table_plan->introtext);echo "
";