My code is working well on localhost and also on godaddy server.But on ipage I am getting "500 Internal Server error" with this code.
My local server has PHP Version 5.4.7 and my ipage hosting has PHP Version 5.3.13

```
         public function cms($cid,$vars) {
   global $db; 
    //fetch cms data from database 

          $stmt = $db->prepare("SELECT * FROM cms");
          $stmt->execute();
          $row = $stmt->fetchAll(PDO::FETCH_ASSOC);        

       return $row;

   if ($cid == ""){
            $stmt = $db->prepare("SELECT * FROM cms");
            $stmt->execute();
            $row = $stmt->fetchAll(PDO::FETCH_ASSOC);  

           return $row;
      }

      else {
          $stmt = $db->prepare("SELECT * FROM cms WHERE id=? ");
          $stmt->execute(array($cid));
          $row = $stmt->fetchAll(PDO::FETCH_ASSOC);    

        if ($vars == "") {
    return $row;
        }
        else {
            $ret = [];
            foreach ($vars as $var) {
                $ret[] = [
                    $var => $row[0][$var]
                        ];
                }
            return $ret;
         }

        }  
  }

```