While im here im having problems with my image function that brings up all the image paths in the database depending on whether they have been specified to be..ie a field called front - if it has a 1 then it will be included if 0 not.
I want to count the number of rows with 1 and if there arent any display a message saying "no images" otherwise it will display the paths.
this is my effort that doesnt work:
function images() {
include("dbconnect.inc.php");
$sql2 = "select * from images where front =1";
$result3 = mysql_query($sql2,$conn);
$image = $row3['path'];
$front = $row3['front'];
echo "<table class='block' align='center' width='100%' cellpadding=0 cellspacing=0>";
echo "<tr><td class='heading'>Gallery</td></tr>";
if($front <0) {
echo "<tr><td>no images</td></tr>";
}else {
while($row3 = mysql_fetch_assoc($result3))
{
echo "<tr><td><img src='images/$image'></td></tr>";
}
}
echo "</table>";
}