Начал осваивать вывод новостей, написал код:
<?php
if (!$Module or $Module == 'main') {
$Pm1 =R::getAssoc('SELECT * FROM news ORDER BY id DESC LIMIT 6');
}
foreach ($Pm1 as $Row) {
echo '<a href="/news/material/id/'.$Row[id].'"><div class="DivNews"><span>ID новости:'.$Row['id'].' |Добавил: '.$Row['author'].' | '.$Row['data'].'</span> | '.$Row['name'].'</div></a>';
}
?>
Все поля выводит, кроме id.
Написал небольшой скрипт на генерацию новостей. Код:
<?php
$n = rand(11,100000);
$i = 1;
while ($i <= 5){
$new = R::dispense('news');
$new->name = 'Zagalovok '.$i;
$new->author ='User'.$i;
$new->text ='Text'.$n;
$new->data = date("d m Y");
R::store($new);
$i++;
}
header('Location:/news');
?>
Array ( [7] => Array ( [name] => Zagalovok 5 [author] => User5 [text] => Text54433 [data] => 04 05 2018 ) [6] => Array ( [name] => Zagalovok 4 [author] => User4 [text] => Text54433 [data] => 04 05 2018 ) [5] => Array ( [name] => Zagalovok 3 [author] => User3 [text] => Text54433 [data] => 04 05 2018 ) [4] => Array ( [name] => Zagalovok 2 [author] => User2 [text] => Text54433 [data] => 04 05 2018 ) [3] => Array ( [name] => Zagalovok 1 [author] => User1 [text] => Text54433 [data] => 04 05 2018 ) [2] => Array ( [name] => Zagalovok 1 [author] => User1 [text] => Text5891 [data] => 04 05 2018 ) )
В чем может быть проблема?