I have a page search.php where I am displaying all the table data from mysql database, say for the sql code:
select * from employee;
I also have a search form name employee_search_form which is used to search for employee within a certain age group, like in the following code:
select * from employee where age between 30 and 40;
Till here the code works good. When I open search.php for first time it shows all employees. Later when I search for a particular range of employees it works too.
But how to reset the search.php to original, showing all employees again. I tried reloading page after searching between 30 and 40. But it still shows the employees between 30 and 40 only.
The code used for searching data is
if ( isset( $_POST['submit_filter'] ) )
{
$results = mysql_query('select * from employee where age between 30 and 40')
}
else
{
$results = mysql_query('select * from employee')
}
where submit_filter is name of submit button. ( more check conditions would be added in future )
after this I am using while loop to print the table data.
How this problem have to be solved. Please suggest me how to come over with it. I am new to using php and html. Any suggestions are welcome.