Skip to content

Instantly share code, notes, and snippets.

@richistron
Last active December 22, 2015 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richistron/6497884 to your computer and use it in GitHub Desktop.
Save richistron/6497884 to your computer and use it in GitHub Desktop.
<?php
$db = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
$sql = sprintf("SELECT contenido FROM barra_lateral WHERE 1 ");
echo '<div id="barra_lateral">';
foreach($db->query($sql) as $row){
echo '<div class="item">' . $row['contenido'] . '<br></div>';
}
echo '</div>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment