Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dbServername = "localhost";
- $dbUsername = "root";
- $dbPassword = "";
- $dbName = "phplessons";
- $conn = "mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName)";
- ?>
- <?php
- include_once 'includes/dbh.inc.php';
- ?>
- <!DOCTYPE html>
- <html>
- <body>
- <?php
- $sql = "SELECT * FROM posts;";
- $result = mysqli_query($conn, $sql);
- $resultCheck = mysqli_num_rows($result);
- if($resultCheck > 0) {
- while ($row = mysqli_fetch_assoc($result)) {
- echo $row['subject'];
- }
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment