Show when no search result in database

Asked

Viewed 98 times

0

In the SQL search, if you do not return the result, you will see a "No results found" message. Okay, when you search, you find a result and when you don’t 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 haven’t even researched anything. How to take this text without changing the command of it to appear when there are no results in BD?

I tried with Javascript used style show/none function in the onClick of Submit from the search button and did not help, in search return without results the message flashed and disappeared.

I’m wearing it like this:

<?php if ($totalRows_buscar == 0) {  ?>
  <?php print "Nenhum resultado encontrado."; ?>
  <?php } ?>
  • It is necessary for you to put the complete code, to give a concrete answer.

  • It’s 950 lines, too long to stick it all together

  • If the code is too big, try to reduce it to a [mcve] <-- read this link, have several tips to reduce your code to post here

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.