hazade Posted March 9, 2007 Share Posted March 9, 2007 I implemented the PHP News (http://newsphp.sourceforge.net/index.php) software into my website and need a little help modifying it. Basically there is a script to pull the latest news entries (amount set by a variable stored in the db; currently set to 4) from a database and display it on your page. What I am trying to do is figure out a way to skip the newest entry and display the next 4 entries. From what I can tell, the code used to pull the news from the database is $sql = 'SELECT id,posterid,time,subject,titletext FROM ' . $db_prefix . 'news WHERE catid=\'' . $_GET['headcat'] . '\' AND trusted = 1 ORDER BY id DESC LIMIT ' . $Settings['numtoshowfhl'] . ''; Basically I guess what I want to do is change the id to subract 1 from the latest entry. Am I on the right track here or do I need to look somewhere else? Quote Link to comment Share on other sites More sharing options...
artacus Posted March 9, 2007 Share Posted March 9, 2007 You need to modify the LIMIT part LIMIT (number to skip), (number to fetch) Quote Link to comment Share on other sites More sharing options...
hazade Posted March 9, 2007 Author Share Posted March 9, 2007 That worked perfectly! wow that was too easy.. thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.