S
S
SeiLove2015-11-05 16:40:52
CMS
SeiLove, 2015-11-05 16:40:52

How to display from the database page by page in netcat?

According to the instructions, I do this in the design layout:

$nc_core = nc_Core::get_object();

// Пример №1
// Запрос к таблице БД
// Используется ассоциативный массив
// Третий параметр не указан и по умолчанию равен 0
$res = $nc_core->db->get_row("SELECT * FROM `tab`", ARRAY_A );

if (!empty($res)) {
    foreach ($res as $row) {
        // Последовательно выводятся каждое из полей строки
        echo "<p>".$row['id']."</p> <br>" ;
    }
}

 browse_messages($res, 15);

and nothing comes out.. I tried to make a component with a code for obtaining data from the database, in order to then display it browse_messages, but it also did not work. How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sparton, 2015-11-12
@Sparton

Make such a conclusion through the component or its template. Don't make a bike. Everything for this is there, the nc_objects_list function
The entire data set is stored in the components, and the component in the section. That's where you pull the data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question