Show when there is no search result in the database

0

In the SQL query, if no return result is to appear a "No results found" message. OK, when you search, find a result and when it does not have it shows the message - so far so good. The problem is that at the time of opening the document, the text "No results found" is already there and I did not even search anything. How do I throw this text without changing the command it appears when it has no results in the DB?

I tried with Javascript used style show/none with function in onClick of submit of the search button and did not advance, in search return without results the message blinked and disappeared.

I'm using this way:

<?php if ($totalRows_buscar == 0) {  ?>
  <?php print "Nenhum resultado encontrado."; ?>
  <?php } ?>
    
asked by anonymous 20.05.2018 / 20:18

0 answers