S
S
Sergey Goryachev2016-08-31 21:08:44
CMS
Sergey Goryachev, 2016-08-31 21:08:44

How to make a request to the database and output to the Joomla 3 site?

I'm trying to write my own simple module.
Through the component, the data enters the database: record number (number), record name (name), link to the record (link).
Everything goes well in the base, there are no questions.
But I can't bring it to the site, I don't have enough skills with php and mysql.
Here is what has already been done.
mod_pravinfo

<?php
defined('_JEXEC') or die;
require_once __DIR__ . '/helper.php';
$pravinfo = modPravinfoHelper::getPravinfo();
require JModuleHelper::getLayoutPath('mod_pravinfo', $params->get('layout', 'default'));

The helper file sees normally, we go further.
helper.php
<?php
defined('_JEXEC') or die;
class modPravinfoHelper
{
  public static function getPravinfo()
  {
    $app = JFactory::getApplication();
    $db = JFactory::getDbo();
    // собственно, на этом я и застрял, тут нужно писать запросы
  }
}

And all this should be output in the format.
default.php
<tr>
<td><span>Номер записи</span></td>
<td><span>Название записи</span></td>
<td><a href="#" target="_blank"><span>Ссылка на запись</span></a></td>
</tr>

Records will be pieces 10, they will be deduced accordingly will be through search foreach.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2016-08-31
@webirus

stackoverflow.com/questions/15571943/joomla-3-jdat...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question