Return to Snippet

Revision: 44266
at April 8, 2011 21:04 by JonnySnip3r

Initial Code
// Connect to the server::
	or die('Sorry, an error occurred when connecting to the server.');

// Select the database::
	or die ('Sorry, an error occurred when select the database.');
	// Set uo our sql statement::
	$sql = "SELECT * FROM posts ORDER BY post_id DESC";

		<title>Carl's Forum</title>

		$query = mysql_query($sql);
		while($row = mysql_fetch_array($query))
			// 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>';

Initial URL

Initial Description
Just a simple database script.

Initial Title
Simple database script

Initial Tags
database, simple

Initial Language