For work I am trying to write a web interface to our database. They guys will need to run reports with it. My question it this:

If I have 3 text fields, on an html form, and 2 of them are filled out but one is blank, how does mysql interpret the blank field when using a prewritten query with the perl DBI. Do i need to convert it from a blank to a "*" so that it knows that I am looking for anything in that field ?

if the following is the query i want to use and field3 is blank, what do I have to do to have MySQL read that as looking for anything, in datafld3, instead of looking for a blank field, in datafld3?

select * from table where datafld1=field1 datafld2=field2 datafld3=field3