introducing ordinary people to extraordinary, ever-growing life in Jesus, our Savior

End Live Process

[php] // FORMAT VALUES
//=======================================================================
$lsUser = “”;
$lsPW = “”;
$curDate = date(“Y-m-d H:i:s”);

// RETRIEVE FROM FORM ON add-a-sermon PAGE
//=======================================================================
$lsUser = $_POST[“lsUser”];
$lsPW = $_POST[“lsPW”];

if (($lsUser == “Tim”) and ($lsPW == “ByGraceAlone1!”)) {

// —- INSERT INTO LIVE VIDEO —————————————————————-

$link = mysqli_connect(‘whitehall.church’, ‘wbfc3300’, ‘REDSreds1005!!’);
if (!$link) {
echo “Error: Unable to connect to MySQL.” . PHP_EOL;
echo “Debugging errno: ” . mysqli_connect_errno() . PHP_EOL;
echo “Debugging error: ” . mysqli_connect_error() . PHP_EOL;
exit;
}

$query = “UPDATE livestream set lsEnd='”.$curDate.”‘ where lsEnd is null;”;
mysqli_select_db($link, “wbfc3300”);
$result = mysqli_query($link, $query);
if (!$result) {
$message = ‘Invalid query: ‘ . mysqli_error() . “\n”;
$message .= ‘Whole query: ‘ . $query;
die($message);
echo “Could not connect to the table!”;
}

mysqli_close($link);

// —- TELL ‘EM IT WORKS —————————————————————-
echo “

You are No Longer Live!

“;
echo “

Your video is now offline.

“;
echo “

Visit the Live Stream to make sure.

“;

echo “

Go Live again.

“;
}

[/php]