/ Published in: PHP
Just a simple database script.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // Connect to the server:: // Select the database:: // Set uo our sql statement:: $sql = "SELECT * FROM posts ORDER BY post_id DESC"; ?> <html> <head> <title>Carl's Forum</title> </head> <body> <?php { // Place the title_post inside a header 1 tag, so it looks nice and big:: echo '<h1>' . $row['post_title'] . '</h1>'; // Now place the post_body inside some paragraph tags so they look nice:: echo '<p>' . $row['post_body'] . '</p>'; } ?> </body> </html>