This is above the html to pull my blog posts from my db:
<? include("../connect.inc");
$query = ("SELECT FROM blog ORDER BY id DESC");
mysql_query($query) or die(mysql_error());
$nrows = mysql_num_rows($query);
$post_pull1 = mysql_query("SELECT FROM blog WHERE id = $nrows")or die(mysql_error());
$post_pull2 = mysql_query("SELECT * FROM blog WHERE id = $nrows-1") or die(mysql_error());
$post1 = mysql_fetch_assoc($post_pull1);
$post2 = mysql_fetch_assoc($post_pull2);
?>
Then to use the posts I have:
<? echo $post1['title']; ?>
and
<? echo $post2['date']; ?>
etc.
This doesn't work, I am getting no mysql errors but the space is blank where the post title etc should be echoed.
Any assistance gratefully received, also from my first query that pulls all posts from my blog table, how can I Access the latest post with the highest id number without actually using the id number, and without issuing another query like I have done above after finding the number of rows and using that as the highest id.
also how to access each post after that.