Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try {
- $user = 'user';
- $password = 'password123';
- $db = new PDO('mysql:host=127.0.0.1;dbname=ldsaccount', $user, $password);
- }
- catch (PDOException $ex) {
- echo 'Error!: ' . $ex->getMessage();
- die();
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Scripture Resources</title>
- </head>
- <body>
- <h1>Scripture Resources</h1>
- <?php
- $queried = $db->query('SELECT * FROM scriptures');
- $scriptures = $queried->fetchAll(PDO::FETCH_ASSOC);
- foreach ($scriptures as $scripture) {
- echo "<p><strong>${$scripture['book']}</strong> ${$scripture['chapter']}:${$scripture['verse']} - '${$scripture['content']}'</p>"
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement