I am having a form which contains some field(language,Datefrom,Dateto,Status).There is a submit button.I want to fetch the data based on the value filled on these field.My query to ignore the field which is not filled.How can i write the query.
Select * from tbldep where (language='$language') AND ( Date between '$Datefrom' AND '$Dateto')AND (status='$status')
My query to ignore the value which is not filled. Suppose user has not filled the value of date in DateFrom field in that case query should fetch the all record which are less than DateTo value.