Skip to content

Instantly share code, notes, and snippets.

@byronwade
Created September 11, 2013 20:13
Show Gist options
  • Save byronwade/6529140 to your computer and use it in GitHub Desktop.
Save byronwade/6529140 to your computer and use it in GitHub Desktop.
<?php
$con=mysqli_connect("##########","thorbis","###############","thorbis");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
date_default_timezone_set('America/New_York');
?>
<?php
if ($Res = mysqli_query($con,'SELECT * FROM `Blog` ORDER BY `Date` DESC')) {
while($Row = $Res->fetch_object()) {
$p = $Row->BlogP;
$title = $p;
if (strlen($title)>200){
$rtitle = substr($title,0,200)."...";
}else {
$rtitle = $title;
}
echo"$rtitle";
echo <<<END
<li class="show">
<div class="spacer1"></div>
<div class="blogbackground background-style3">
<div class="row">
<article class="thinner">
<section>
<div class="12u">
<a data-lightbox="image-1" href="$Row->upload_location"><img class="floatright blogimage" src="$Row->upload_location"></img></a>
<h1 class="blogh1">$Row->BlogTopic</h1>
<i id="$Row->Date" class="blogdate">$Row->Date</i>
<p class="blogp">$rtitle</p>
<i class="blogurl"><a href="$Row->BlogURL">ReadMore</a></i>
</div>
</section>
</article>
</div>
</div>
</li>
END;
}
}
mysqli_close($con);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment