<?php
//db parameters
$db_username = 'username';
$db_password = 'password';
$db_database = 'databasename';
$blog_url = 'http://www.elated.com/blog/'; //base folder for the blog
//connect to the database
mysql_connect(localhost, $db_username, $db_password);
@mysql_select_db($db_database) or die("Unable to select database");
//get data from database
$query = "Select * FROM wp_posts WHERE post_type='post' AND post_status='publish' ORDER BY id DESC LIMIT 1";
$query_result = mysql_query($query);
$num = mysql_numrows($query_result);
//close database connection
mysql_close();
//assigning data to variables
$blog_date = mysql_result($query_result, 0, "post_date");
$blog_title = mysql_result($query_result, 0, "post_title");
$blog_content = mysql_result($query_result, 0, "post_content");
//$blog_permalink = mysql_result($query_result, 0, "guid"); //use this for 'p=11' format
$blog_permalink = $blog_url . mysql_result($query_result, 0, "post_name"); //combine blog url, with permalink title. Use this for title format
//date
$blog_date = strtotime($blog_date);
$blog_date = strftime("%b %e", $blog_date);
$blog_content = strip_tags($blog_content);
?>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
</head>
and now, place the following code in the div, you want to display!!
<div>
<h2><?php echo $blog_date; ?>:</h2>
<i><?php echo $blog_title; ?> </i>
<p><?php echo $blog_content; ?></p>
</div>
[Edited by matt on 10-Dec-09 20:45]
--
knowledge is to share.. not to compare!!
www.c4di.org.uk
www.elated.com



