That answered what I asked and also a question I needed to ask, but didn't. Thanks!
But, after thinking about it, I think I asked the wrong question to begin with!!! (sorry!) I will try to ask it the right way now...
I want to be able to pull the most recent article based on the date field and subject field. I can do that now, just like you said using this:
$Query2 = "SELECT *, DATE_FORMAT(date, '%m-%d-%Y') AS date_format from $TableName where subject LIKE '%feature%' ORDER BY date desc LIMIT 0,1";
But I want to be able to also be able to display a specific article, if one is specified, i.e. www.foo.com/article.php?article=n, in the same output page. Right now I'm coming up with either the random article or both articles.
I tried to substitute my code in your code where I think it is supposed to go. Is this right?
$article_id = intval( $GET[ 'article_id' ] );
if( !$article_id ) {
// show newest
$Query2 = "SELECT *, DATE_FORMAT(date, '%m-%d-%Y') AS date_format from $TableName where subject LIKE '%feature%' ORDER BY date desc LIMIT 0,1";
} else {
// show a specific
$sql = "select *, DATE_FORMAT(date, '%m-%d-%Y') AS date_format FROM articles where article_id = '$article_id' ORDER by date DESC";
} // end if
// now show article
And.......
I need to be able to get to this page and show a link for the newest article.