News Script

I only have a basic understand of PHP as of know so be gentle.

I recently completed a tutorial in which I built an extremely simple content management (aka news) script. I have it to where I can create articles into a database, and I have also wrote code which will show the newest article I have written. This is that code.

[code]<?
include(“site/site.inc.php”);
include(“site/site.funct.php”);
db_login();

//Generate the query

$query = “SELECT title, content FROM news ORDER BY id DESC”;
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());

// get resultset as object

$send = mysql_fetch_object($result);

// print details

if($send) {
echo “$send->title
”;

echo nl2br($send->content);
}
?> [/code]

What I want is to make a code that will show the second to newest article. I want it to be a completely different piece of code, because I want to add it to a different location. I have played around with it a little, but not really made any progress. If I left out any additional info needed let me know.

Any help would be greatly appreciated.

Solved it myself

Sponsor our Newsletter | Privacy Policy | Terms of Service