Cliftron Posted September 24, 2009 Share Posted September 24, 2009 Hey all. I need some help. something really basic. Im trying to build my own cms. I been coding php for about half a year. Anyway my news system has one flaw. it doesn't have a limit on posts or a system to show a next page of news articles. Heres the code for my news include: <?php $con = mysql_connect("***","***","***"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("soundworkcms", $con); $result = mysql_query("SELECT * FROM news ORDER BY Date DESC"); while($row = mysql_fetch_array($result)) { echo '<div class="left_box">'; echo '<div class="left_title"><span class="textheader">'; echo $row['Title']; echo '</span> - <span class="textauthor">'; echo $row['Author']; echo ' '; echo $row['Date']; echo ' </span></div> <div class="left_img"><img src="images/img.jpg" /> </div> </div> <div class="article"> <p>'; echo $row['Article']; echo '</p> </div>'; } mysql_close($con); ?> Id love some help. I have been stressing over this Much Appreciated. Link to comment https://forums.phpfreaks.com/topic/175362-help-with-news-system/ Share on other sites More sharing options...
Bricktop Posted September 24, 2009 Share Posted September 24, 2009 Hi Cliftron, What you're requiring here is something called "Pagination" I'd recommend you read Crayon Violent's excellent tutorial over at http://www.phpfreaks.com/tutorial/basic-pagination Hope this helps. Link to comment https://forums.phpfreaks.com/topic/175362-help-with-news-system/#findComment-924113 Share on other sites More sharing options...
Cliftron Posted September 24, 2009 Author Share Posted September 24, 2009 Thank immensely for that Link to comment https://forums.phpfreaks.com/topic/175362-help-with-news-system/#findComment-924416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.