Kingy Posted April 10, 2008 Share Posted April 10, 2008 I have created a news script and its working all good.. whats im doing is <?php while($news_row = mysql_fetch_array($selectnews)) { \\LOOP THE NEWS and echo it as it comes out \\ I then put an <hr> seperator here between each news post } ?> what i would like to no is, how i can stop the <hr> seperator if it is the last news post. Ill try and draw an image so you get the idea.. DISPLAY NEWS POST ONE HERE ------------------------------- DISPLAY NEWS POST TWO HERE ------------------------------- DISPLAY NEWS POST THREE HERE ------------------------------- <- would like to get rid of the last seperator. Link to comment https://forums.phpfreaks.com/topic/100448-end-of-mysql/ Share on other sites More sharing options...
friedemann_bach Posted April 10, 2008 Share Posted April 10, 2008 My idea: save the total number of news posts with mysql_num_rows($your_query), set up a counter and increase it every time you echo an entry, then check whether it was the last entry and if not, echo a horizontal ruler. But maybe there is a more elegant way. Link to comment https://forums.phpfreaks.com/topic/100448-end-of-mysql/#findComment-513697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.