2 Replies Latest reply: Jan 27, 2011 3:55 PM by BCDoherty RSS

    Submitting an empty search returns all records (php / MySql)

    Wookie

      I have a php search page where if I enter a search term the correct results are displayed as required. However if I leave the search box empty and press submit, the results page displays all the records from the MySql database.

       

      How do I prevent this from happening? How could I display some sort of error message when the user tries to submit an empty search?

       

       

      Thanks