$query = "SELECT * FROM `base` WHERE `name` = 'test' order by `date` DESC LIMIT 10";
$result = $mysqli->query($query);
$row = $result->fetch_array(MYSQLI_NUM);
//$mysqli->close();
if($row > 0){
$view = array();
while($row = $result->fetch_assoc())
{
$view[] = $row;
}
print_r($view);
$query = "SELECT * FROM `base` WHERE `name` = 'test' order by `date` DESC LIMIT 10";
if ($result = $mysqli->query($query)) {
while ($row = $result->fetch_assoc()) {
// code
}
}