I edited the post for a better understanding. This is my first project as a student-trainee. It is an equipment monitoring system that keeps a record of computer equipment. This
switch($state AND $condition)
will evaluate to true or false depending of the values $state
and $condition
.
So the only useful cases then are
case true
case false
case default
In your case you should use if / else construct.
Because asked in the comments how to write the conditions anyway in a switch construct see the nested code here:
switch ($state)
{
case "allstate":
if ($condition == "allcondition")
$sql3 = "SELECT *FROM eq_inv WHERE eq_condition='Available/Unassigned'";
break;
case "new":
if ($condition == "allcondition")
$sql3 = "SELECT *FROM eq_inv WHERE eq_condition='Available/Unassigned' AND eq_state='new'";
break;
case "old":
if ($condition == "allcondition")
$sql3 = "SELECT *FROM eq_inv WHERE eq_condition='Available/Unassigned' AND eq_state='old'";
break;
case "Unknown state":
switch ($condition)
{
case "Available/Unassigned":
case "allcondition":
$sql3 = "SELECT *FROM eq_inv WHERE eq_condition='Available/Unassigned' AND eq_state='Unknown state'";
break;
}
}