php - Display all records from db with empty form fields -


Is it possible to get all the forms from the database when you do not enter any field in the form

In some way like this, in some sort of conditional query, I query a query $, which gives me some data after filling out the form but I need an evet to display all the data from the database when working in the country and country Are empty, there are also two other date fields, some time interval code Filter results in: ...

  $ country = $ _GET ['country']; $ Work = $ _GET ['work']; If ($ country == 0 and $ work == 0) echo $ query1; And $ query; $ Query1 = "SELECT ...." $ query = "SELECT ...."   

.....

thanks

Edit & gt; Hi, I've tried and all this data witch fixes. _But I have an error now: when I fill out the field field the question was empty. Code like this:

  if (empty ($ country) and below ($ work)) {$ query1 = "SELECT line_number, country, project_type, code, start_date, and_date, work, Start with the name ENG \ "$ start_date \" and \ "$ end_date \" from the ORDER country ASC "start_date";}; $ Query = "SELECT row_number, country, project_type, code, start_date, end_date, work, name from where Country country = \ "$ country \" and '% $ work%' and start_date between \ "$ start_date \" and \ "$ end_date \" ORDER by start_date ASC "; $ Qry_result = mysql_query ($ query) ) Or die (mysql_error ()); $ Qry_result1 = mysql_query ($ query1) or die (mysql_error ()); if <(empty ($ country) and Person ($ work)    

  {$ Query = "SELECT *")   

This should work fine.

In addition, you should use the POST method instead of the form Should, do not get .

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -