Last active
August 29, 2015 14:02
-
-
Save johnhiott/c66986cacc2645eb37f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
$db = new PDO("mysql:host=$C9_IP;dbname=$C9_DB", $C9_USER, $C9_PASS); | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
} | |
catch(Exception $ex) { | |
die($ex->getMessage()); | |
} | |
$tagStmt = $db->prepare("SELECT tag FROM Tag WHERE postid = :postid"); | |
$tagStmt->bindValue(":postid", $row["id"]); | |
$tagStmt->execute(); | |
while($tagRow = $tagStmt->fetch(PDO::FETCH_ASSOC)) { ?> | |
<span class="label label-default"> | |
<?php echo $tagRow["tag"] ?> | |
</span> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment