PDA

View Full Version : Maximum Entries


Jamie
January 25th, 2005, 22:31
This is mainly for the people who helped with the blog as they know the script (hopefully).

I am wanting to specify a maximum amount of entries on index.php before the oldest entry is deleted and inserted in to an archives folder to allow room for the newst entry.

Any help would be great.

Alex
January 26th, 2005, 00:49
This will only show 5 entries on the page.
[syntax:86007af336="php"]
$get = mysql_query("SELECT * FROM entries ORDER BY id DESC LIMIT 0, 5;") or die("Mmm pie:" . mysql_error());

[/syntax:86007af336]

I'm trying to work out a good method to do the second part.

Jamie
January 26th, 2005, 11:21
That simple? Things are a lot more simple than I think in PHP, it is about time I got myself a chart with the PHP functions on... Thanks Alex. I look forward to your method for the second part if you manage to do it.