I keep forgetting about PHP.net. Thanks for that. I just was not able to get the isset command to work. But, I did get something to work. I now just have this at the top:
$qry="SELECT * FROM FORMS ";
if($sname != "") {
$qry.="WHERE NAME LIKE '%$sname%' ";
}
$qry.="ORDER BY NAME";
and the query is working great. But, I have a different database which has a little bit different of code, which is not working. Here is the code:
$qry="SELECT * FROM POLICY ";
if($sname != "") {
$qry.="WHERE TYPE = '$tname' and NAME LIKE '%$sname%' ";
}
$qry.="ORDER BY NAME";
The sname is the same as the other database and that is working fine. But, the tname variable is set using a form with a select. I have three settings for that field. I want the first one and default one to be a value of "" so it will select all. But, it does not like that. How can I tell my query command to be "Where TYPE = '' and NAME LIKE '%test%'" ?