Skip to content

Instantly share code, notes, and snippets.

@FlorianH
Created September 19, 2009 21:19
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 FlorianH/189594 to your computer and use it in GitHub Desktop.
Save FlorianH/189594 to your computer and use it in GitHub Desktop.
<?php
$connection = mysql_connect('localhost', 'root', '');
if (!$connection) {
echo "Verbindung konnte nicht hergestellt werden.";
} else {
mysql_select_db('test001', $connection);
$query = mysql_query('SELECT * FROM `guestbook`;', $connection);
while ($entry = mysql_fetch_assoc($query)) {
echo '<div class="name">'.$entry['name'].' schrieb:</div>';
echo '<div class="text">'.$entry['text'].'</div>';
echo '<hr />';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment