I have this function, but it doesnt work. Basically the list outputs a list of news features, and puts a line under neath each article to seperate them. However once the last article has been reached, I don’t want the break to be shown.
this is my code, any help would be appreciated as i am really struggling on this. Just need to determine the last item in the array, and stop the
from being output.
This code isnt working, but i have put it here to show what my thinking process is at the moments.
[php]function newsFeature(){
$event = “SELECT imgname, title, content, pkID from news ORDER BY date, time DESC LIMIT 5”;
$event_page = query($event);
$count = numRows($event_page);
while ($row = mysql_fetch_assoc($event_page))
{
$rowcount = $count;
$para = substr($row['content'] , 0,100);
$result .= '<article>';
$result .= '<a href="news-article.php?pkID=' . $row['pkID'] . '"><img src="uploads/thumbs/' . $row['imgname'] . '" alt="" width=116 height=83/ ></a>';
$result .= '<h2><a href="news-article.php?pkID=' . $row['pkID'] . '">' . $row['title'] . '</a></h2>';
$result .= '<p>' . $para . '...</p>';
$result .= '<p><a class="read-more" href="news-article.php?pkID=' . $row['pkID'] . '">Read more<span></span></a></p>';
$result .= '</article>';
if($row != end($row[])){
$result .= '<hr class="split">';
}
}
return $result;
} [/php]