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>'; } ?> Link to comment https://forums.phpfreaks.com/topic/129148-solved-php-while-loop-limit-help-plz/ 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>'; } ?> Link to comment https://forums.phpfreaks.com/topic/129148-solved-php-while-loop-limit-help-plz/#findComment-669583 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 Link to comment https://forums.phpfreaks.com/topic/129148-solved-php-while-loop-limit-help-plz/#findComment-669584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.