hovercraft
Technical User
I have a form with 4 fields for returning a recordset. The idea is if there is any field left empty, the value is the wildcard '%'. Such that if they are all 4 empty, every record is returned.
This works fine, except when there is as null value in any of the given fields in the source table. Then no matter if you complete all 4 fields nothing is returned. How can I allow for null or empty values?
here is what I have:
Thanks for your help
Dave
This works fine, except when there is as null value in any of the given fields in the source table. Then no matter if you complete all 4 fields nothing is returned. How can I allow for null or empty values?
here is what I have:
Code:
$search_last = $_REQUEST['srchlast']."%";
$search_case = $_REQUEST['srchcase']."%";
$search_cit = $_REQUEST['srchcit']."%";
$search_status = $_REQUEST['srchstatus']."%";
$mydeflist = ("SELECT * FROM tmp_tbl_mysqlactive WHERE cust_id = '".$_SESSION['mycustid']."' AND def_nmlast LIKE '".$search_last."' AND def_casenbr LIKE '".$search_case."' AND def_citnbr LIKE '".$search_cit."' AND def_casestatus LIKE '".$search_status."' GROUP BY scs_id ORDER BY def_nmlast");
Thanks for your help
Dave