0

I am trying to set up an If Else statement which decides which MYSQL query to use depending on the values submitted in a form.

The problem I am having is that no matter which values I send in the form, even if they are not ALL, only the first query gets called ever.

Here is my code:

 if($department = 'ALL' && $property_type = 'ALL')

 } elseif ($department = 'ALL'){
Mofi
  • 46,139
  • 17
  • 80
  • 143

1 Answers1

1

Use == or === to compare not =.

= is an assignment operator.

== and === are comparative operators.

Script47
  • 14,230
  • 4
  • 45
  • 66