Created
July 19, 2014 17:35
-
-
Save samroar/184147a35256a51685a9 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
| <!doctype HTML> | |
| <html> | |
| <head> | |
| <title>reddit: the front page of the internet</title> | |
| <link href="reddit.css" rel="stylesheet"/> | |
| <script src ="reddit.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <?php | |
| $dbh = new PDO('mysql:host=localhost;dbname=reddit','root',""); | |
| foreach($dbh->query("SELECT id, title, user,subreddit,url,timestamp from posts") as $row) { ?> | |
| <div class="container"> | |
| <div class="title"><?php echo $row['title']; ?></div> | |
| <div class="info"> | |
| submitted <?php echo $row['timestamp']; ?> by <?php echo $row['user']; ?> to <?php echo $row['subreddit']; ?> | |
| </div> | |
| </div> | |
| <?php } ?> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment