I have a module built in Joomla to fetch data from an external database. I want to display the table data in my Joomla page and although the module loads up fine, no data is displayed.
Here is what I have in my helper.php page.
<?php
defined('_JEXEC') or die('');
class ModChannelLineupsHelper
{
static function doDataFetch ($param) {
// ...
// ...
$option = array(); //prevent problems
$option['driver'] = 'mysql'; // Database driver name
$option['host'] = 'localhost'; //
$option['user'] = 'usenamehere'; // User for database authentication
$option['password'] = 'passhere'; // Password for database authentication
$option['database'] = 'cars'; // Database name
$db = JDatabaseDriver::getInstance( $option );
// Get a db connection and create a query object.
$query = $db->getQuery(true)
->select('*')
->from($db->qn('zcars'))
->where($db-qn('Make_ID') . ' = 13')
->order($db->qn('Model') . ' ASC');
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ( $row as $row ) {
echo $row->Model;
}
}
}
Do i need to do something special in Joomla to display the information?
Thanks