SQL query question
Posted: Tue Aug 10, 2010 11:48 am
Ok, I have this code that is part of a form that create dynamic drop downs my my database.
I want to hide the drop down and query 3 options for the form report. I need some help with the sql query.
For example deviceuseage can be server, printer and workstation.
I tried without any success.
Thanks for the help.
I want to hide the drop down and query 3 options for the form report. I need some help with the sql query.
Code: Select all
if ((!empty($_GET['deviceuseage']))&&($_GET['deviceuseage'] != 'all'))
{
$sql .= " and deviceuseage like '". addslashes($_GET['deviceuseage'])."%' ";
}I tried without any success.
Code: Select all
if ((!empty($_GET['deviceuseage']))&&($_GET['deviceuseage'] != 'deviceuseage = 'server' OR deviceuseage = 'printer' OR deviceuseage = 'workstation'))
{
$sql .= " and deviceuseage like '". addslashes($_GET['deviceuseage'])."%' ";
}