Created
March 28, 2017 03:18
-
-
Save GoodChancer/bd088b165622576e515dc4903cf4a6fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/* Get Styles */ | |
$stmt = $pdo->prepare('SELECT style_id FROM album_style WHERE album_id = ?'); | |
$stmt->execute([$albumCurrent['id']]); | |
$styles = $stmt->fetchAll(PDO::FETCH_COLUMN); | |
echo '<ul class="styles">'; | |
if (is_array($styles)) { | |
foreach($styles as $styleID){ | |
$stmt = $pdo->prepare('SELECT name FROM style WHERE id = ?'); | |
$stmt->execute([$styleID]); | |
$style = $stmt->fetchColumn(); | |
echo '<li>'.$style.'</li>'; | |
} | |
}else { | |
echo '<li><i>No styles listed.</i></li>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment