benifactor wrote:
i have a question about what i beleive to be called archiving...
i am building a news script and would like to limit post to be displayed per page i have done this successfully. what i am having probplems with is displaying the next set of news.
here is my code:
<?php
include("core.php");
session_start();
$gi = mysql_query("select * from news ORDER by id asc");
while ($d = mysql_fetch_array($gi)) {
$id = $d[id];
$title = $d[title];
$news = $d[news];
$poster = $d[poster];
$pdate = $d[date];
$ptime = $d[time];
?>
<b>
<u><i><?php echo("$title"); ?></u></i><br><br>
<p>
<?php $i = $i + 1; echo("$news"); ?><br><br>
Posted By: <?php echo("$poster"); ?>, On <?php echo("$pdate"); ?> @ <?php echo("$ptime"); ?> <br> <?php if ($nerd == bignerds) {
echo("<a href=\"admin.php\">Edit Post</a> ");
echo(" <a href=\"admin.php?view=delete_news&id=$id&delete=true\">Delete Post</a><br><br>");
}
if ($i >= 1) {
break;
}
?>
</b>
<?php
}
?>
this gets it to stop after one post. i was thinking about setting a variable on the last post displayed, but to me this doesn't seem like the most logical way. if someone could point me in the right direction, or send me to a tutorial on the subject i would greatly appreaciate it...
thank you in advance
Use mysql to display.
SELECT * FROM table WHERE id > $storedone ORDER BY id DESC LIMIT 5
Gives out the 5 news on the next page after the stored one.
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php