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

Sermon Series

[php] $seriesFound = 0;
$myNowDate = date(“Y-m-d”);
if (isset($_GET[‘seriestitle’])) {
$seriestitle = $_GET[‘seriestitle’];
$query = “select * from sermonseries where sSeriesName='”.$seriestitle.”‘”;
}
else
$query = “select * from sermonseries where sBegDate<='".$myNowDate."' and sEndDate>='”.$myNowDate.”‘ order by sID”;

$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;
}

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!”;
}
while ($row = mysqli_fetch_assoc($result)) {
$seriesFound = $seriesFound + 1;
$sid = $row[‘sID’];
$sseriesname = $row[‘sSeriesName’];
$stext = $row[‘sText’];
$sdesc = $row[‘sDesc’];
$sblogurl = $row[‘sBlogURL’];
$sbegdate = $row[‘sBegDate’];
$senddate = $row[‘sEndDate’];
$stime = $row[‘sTime’];
$simg_550_200 = $row[‘sImg_550_200’];
$simg_150_55 = $row[‘sImg_150_55’];
$stagline = $row[‘sTagline’];
}

$result->close();
mysqli_close($link);

// DO THIS IF NO SERIES WAS FOUND
// =====================================================
if ($seriesFound == 0) {
$query = “select * from sermonseries order by sEndDate desc LIMIT 1”;
$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;
}
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!”;
}
while ($row = mysqli_fetch_assoc($result)) {
$seriesFound = $seriesFound + 1;
$sid = $row[‘sID’];
$sseriesname = $row[‘sSeriesName’];
$stext = $row[‘sText’];
$sdesc = $row[‘sDesc’];
$sblogurl = $row[‘sBlogURL’];
$sbegdate = $row[‘sBegDate’];
$senddate = $row[‘sEndDate’];
$stime = $row[‘sTime’];
$simg_550_200 = $row[‘sImg_550_200’];
$simg_150_55 = $row[‘sImg_150_55’];
$stagline = $row[‘sTagline’];
}

$result->close();
mysqli_close($link);
}
// =====================================================
// NOW DISPLAY THE DATABASE CONTENT
if ($seriesFound > 0) {
echo ‘

‘, $sseriesname, ‘

‘;
echo ‘

‘, $stagline, ‘

‘;
if ($simg_550_200<>”) {
echo ‘

Sermon Series Image

‘;
}
echo ‘

Scripture: ‘, $stext, ‘

‘;
echo ‘

Description: ‘, $sdesc, ‘

‘;
echo $myDates;
if ($sblogurl <>”) {
echo ‘

Blog: Read Blogs on this Sermon Series

‘;
}
[/php]

 

 

[php] /* ———————————————————————————————————————- */
/* begin – display sermons by text */
/* ———————————————————————————————————————- */
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
$query = “select * from sermons where sSeries='”.$sseriesname.”‘ and sChurch=’Whitehall’ order by sDate desc”;

$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;
}
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!”;
}
$LAST_Title = “”;
while ($row = mysqli_fetch_assoc($result)):
$THIS_Title = $row[‘sTitle’];
$THIS_Date = $row[‘sDate’];
$THIS_Series = $row[‘sSeries’];
$THIS_Text = $row[‘sText’];
$THIS_Church = $row[‘sChurch’];
$THIS_Audio = $row[‘sAudio’];
$THIS_Video = $row[‘sVideo’];
$THIS_Vimeo = $row[‘sVimeo’];
$THIS_Youtube = $row[‘sYoutube’];
$THIS_Speaker = $row[‘sSpeaker’];
$THIS_Video_DISPLAY = “”;
$THIS_Speaker_DISPLAY = “”;
if ($THIS_Speaker <> “”):
$THIS_Speaker_DISPLAY = $THIS_Speaker;
else:
$THIS_Speaker_DISPLAY = $THIS_Title;
endif;
if ($THIS_Vimeo <> “”):
$THIS_Vimeo_DISPLAY = ‘Watch Video‘;
else:
$THIS_Vimeo_DISPLAY = ”;
endif;
if ($THIS_Youtube <> “”):
$THIS_Youtube_DISPLAY = ‘Play Video‘;
else:
$THIS_Youtube_DISPLAY = ”;
endif;
if ($THIS_Audio <> “”):
$THIS_Audio_DISPLAY = ‘Listen to Audio‘;
else:
$THIS_Audio_DISPLAY = ”;
endif;
$THIS_Video_DISPLAY = ”;
if ($THIS_Youtube_DISPLAY <> “”)
$THIS_Video_DISPLAY = $THIS_Youtube_DISPLAY;
if ($THIS_Vimeo_DISPLAY <> “”)
$THIS_Video_DISPLAY = $THIS_Vimeo_DISPLAY;
if ($THIS_Text <> “”):
$THIS_Text_DISPLAY = ‘‘.$THIS_Text.’‘;
else:
$THIS_Text_DISPLAY = ”;
endif;
$THIS_Title_DISPLAY = ‘        ‘.$THIS_Speaker_DISPLAY.’‘;
$THIS_Series_DISPLAY = ‘‘.$THIS_Series.’‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
endwhile;

$result->close();
mysqli_close($link);
?>

Title Date Series Text Speaker Media
‘.$THIS_Title.’ ‘.date(‘m-d-Y’,strtotime($THIS_Date)).’ ‘.$THIS_Series_DISPLAY.’ ‘.$THIS_Text_DISPLAY.’ ‘.$THIS_Speaker.’ ‘;
echo ‘More Sermon Information‘;
echo $THIS_Audio_DISPLAY;
echo $THIS_Vimeo_DISPLAY;
echo ‘Read '.$THIS_Text.'‘;
echo ‘
[php] }
/* ———————————————————————————————————————- */
/* end – display sermons by text */
/* ———————————————————————————————————————- */
[/php]

 

Return to All Sermons

Outdoor worship throughout the Sundays in July at 9:30amGet more info