Example #1
0
//$stm->bind_param("is",$time,$status);
$response = $stm->execute();
echo $query;
if ($response) {
    echo "successfull prepared statement<br>";
} else {
    echo "unsuccessful prepared statement<br>";
}
$result = $stm->get_result();
//var_dump($result->fetch_assoc());
$msg = '';
/* now you can fetch the results into an array - NICE */
while ($myrow = $result->fetch_assoc()) {
    // use your $myrow array as you would with any other fetch
    if ($myrow["email"] != 'a' && $myrow["email"] != 'az') {
        $questions = get_questions($myrow["category"]);
        $email_html = generate_email($questions, $myrow["category"], $myrow["email"]);
        $status = send_questions($myrow["email"], $email_html, "Daily Subliminal Primes");
        if ($status) {
            //echo "email sent";
            $msg .= "\nemail sent successfully to " . $myrow["email"] . " \t for category " . $myrow["category"] . "\t" . strtolower(date("c")) . "\n";
            // echo "email sent successfully to ".$myrow["email"]." \t for category ".$myrow["category"]."\n";
        } else {
            $msg .= "\nemail unsuccessfully to " . $myrow["email"] . " \t for category " . $myrow["category"] . "\n";
        }
    }
}
echo $msg;
die;
//fwrite($out,$msg);
//fclose($out);
Example #2
0
    $response = $user->execute();
    $result = $user->get_result();
    $myrow = $result->fetch_assoc();
    if ($response) {
        if ($myrow["status"] != "verified") {
            $body = generate_email_html($_POST["email"]);
            $status = send_questions($_POST["email"], $body, "Subliminal Prime Verification");
            if ($status) {
                echo 1;
                exit;
            } else {
                echo 0;
                exit;
            }
        } else {
            $body = generate_email_preference($_POST["email"]);
            $status = send_questions($_POST["email"], $body, "Preference update");
            if ($status) {
                echo 1;
                exit;
            } else {
                echo 0;
                exit;
            }
        }
    } else {
        echo 0;
    }
} else {
    echo "no input found";
}