0

I have an if, elseif statement causing an HTTP 500 Error. I would really appreciate the help figuring such a simple problem out. Thank You!

I have tried changing my conditions, deleting the elseif (which worked), alternating between elseif and else if. I have searched Google, and the answer is nowhere to be found.

<?php 
if($row7Count == 0) {
    // This code works fine
} elseif($editAgent != null) {
    // This code causes HTTP 500 error
} else {
    //This code works fine
}

Expected results is to execute any code within elseif statement, even a simple echo 'testing'; does not work.

Actual results = HTTP 500 Error

treyBake
  • 6,440
  • 6
  • 26
  • 57

1 Answers1

-1

try this:

<?php 
if($row7Count == 0) {
    // This code works fine
} else if(!is_null($editAgent)) {
    echo "test";
} else {
    //This code works fine
}
Alo
  • 160
  • 8
  • That worked. And I'll do it that way. But while applying that "fix", I found an extra braces. I looked over this code 100 times and never once noticed an extra brace. Thanks. – Donald Faulknor May 26 '19 at 21:32
  • probably the main thing was elseif to else if :) – Alo May 26 '19 at 21:36