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
  • 42,677
  • 15
  • 72
  • 128

1 Answers1

1

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

= is an assignment operator.

== and === are comparative operators.

Script47
  • 13,644
  • 4
  • 41
  • 60