I created search function for my blog. Source of my View -
<?php
if (!empty($query)):
foreach ($query as $item):
echo '<h2><a href="/article/' . $item['slug'] . '">' . $item['virsraksts'] . '</a></h2>';
echo '<p>' . nl2br($item['saturs']) . '</p>';
endforeach;
else:
echo 'Nothing found!';
endif;
?>
When I submit a wrong search query, script want to show the error message 'Nothing found!' but this message do not appear. Why the error message don't appear?