php class News function AllNews rows db getInstance query SELECT FROM

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?php
class News {
function AllNews {
$rows = db::getInstance()-> query("SELECT * FROM `news`");
while ($rows -> fetch_all()) {
echo '<div class = "block">';
echo '<b>'.$rows['name'].'</b><br />';
echo $rows['text'];
echo '</div>';
}
}
}
?>