public static function fetchFromDbForEmail($email)
 {
     NewsletterSubscription::$staticErrors = array();
     $sql = "SELECT * FROM bsi_newsletter_subscriptions WHERE email = '" . mysql_escape_string(strtolower(trim($email))) . "'";
     $query = mysql_query($sql);
     if (!$query) {
         die("Error: " . mysql_error());
     }
     if ($row = mysql_fetch_assoc($query)) {
         $newsletterSubscription = NewsletterSubscription::fetchFromParameters($row);
         return $newsletterSubscription;
     } else {
         array_push(NewsletterSubscription::$staticErrors, "No newsletter subscription with email: {$email} exists");
         return null;
     }
 }
<?php

// TODO: Uncomment
include "access.php";
include_once "../includes/SystemConfiguration.class.php";
include "header.php";
global $systemConfiguration;
global $logger;
$errors = array();
$message = "";
$newsletterSubscription = new NewsletterSubscription();
if (isset($_POST['SBMT_REG'])) {
    $logger->LogInfo("Form has been submitted.");
    $newsletterSubscription = NewsletterSubscription::fetchFromParameters($_POST);
    if (!$newsletterSubscription->save()) {
        $logger->LogError("Error saving newsletter subscription.");
        foreach ($newsletterSubscription->errors as $error) {
            $logger->LogError($error);
            $errors[] = $error;
        }
    } else {
        $message = "Values were updated successfully!";
    }
} else {
    if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) {
        $logger->LogInfo("Page was called for edit of id: " . $_REQUEST['id']);
        $id = intval($_REQUEST['id']);
        $logger->LogDebug("Numeric id is: {$id}");
        $newsletterSubscription = NewsletterSubscription::fetchFromDb($id);
        if ($newsletterSubscription == null) {
            $logger->LogError("Invalid request. No newsletter subscription with id: {$id} exists.");