Darkwoods Posted October 19, 2008 Share Posted October 19, 2008 hi im trying to make a 5 limit loops for this code but without any success can anybody help plz <?php $result = mysql_query("SELECT * FROM news ORDER BY id DESC",$connect); while($row = mysql_fetch_array($result)) { echo '<div class="title">'; echo $row['title']; echo '</div>'; } ?> Quote Link to comment Share on other sites More sharing options...
trq Posted October 19, 2008 Share Posted October 19, 2008 <?php $result = mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 5",$connect); while($row = mysql_fetch_array($result)) { echo '<div class="title">'; echo $row['title']; echo '</div>'; } ?> Quote Link to comment Share on other sites More sharing options...
Darkwoods Posted October 19, 2008 Author Share Posted October 19, 2008 THANK YOU solved this little word 'LIMIT' killed me im sure i wont forget it now thank you 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.