Re: archiving?

From: Date: Fri, 17 Feb 2006 09:01:56 +0000
Subject: Re: archiving?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-230625@lists.php.net to get a copy of this message
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("&nbsp; <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)

« previous php.general (#230625) next »