HI there, can anyone look at my code and see why the while loop I have only seems to be doing one iteration.
If i use this code outside of a function and just as a normal script, the loop works fine and displays all results, however in a function it only displays one result.
This is really bugging me, as I want to be able to just call the function into my html rather than having some messy script just in the html.
Thanks
heres the function
function listVox()
{
$sql = "select * from articles WHERE article_type = 'vox' ORDER BY date, time DESC";
$sql_result = mysql_query($sql) or die ("Could not access DB: " . mysql_error());
while ($row = mysql_fetch_assoc($sql_result))
{
$result = "" . $row['title'] . "";
$result .= "<div class=\"picture\">";
$result .= "<img src=\"images/" . $row['image'] . "\" alt=\"\" / width=300 height=250><br />";
$result .= "</div>";
$para = substr($row['content'] , 0,200);
$result .= "" . $para . "";
$result .= "...";
$result .= "<br />";
$result .= "<a href='vox_page.php?articleID={$row['articleID']}' >read more >></a>";
$result .= "<br />";
$result .= "<br />";
$result .= "<br />";
}
return $result;
}