Hi all,
I have some images stored on my server, the details of which are stored in a database. What I need to do is to display the image in a table on two conditions:
a - If there is actually an image uploaded, and...
b - It is approved by the moderator
Here is the php, and the problem I am having is displaying an image in a table only when the two criteria above are met:
echo "<br><b>Here is the Photo portfolio for this supplier:</b></br>";
//Images to go under here
$query3 = "select * from supplierimages where supplierid='" . mysql_real_escape_string($id) . "'";
$result = mysql_query($query3) or die("Couldn't execute query");
//echo $query3;
//Set up rows of result set
while ($row= mysql_fetch_array ($result)) {
$image1 = $row["image1"];
$image1approved = $row["image1approved"];
$image2 = $row["image2"];
$image2approved = $row["image2approved"];
$image3 = $row["image3"];
$image3approved = $row["image3approved"];
$image4 = $row["image4"];
$image4approved = $row["image4approved"];
$image5 = $row["image5"];
$image5approved = $row["image5approved"];
}
echo "<br><table border=\"1\" width=\"100%\" bordercolordark=\"#000000\" bordercolorlight=\"#000000\" name=\"hello\">
<tr>
<td> <img src=\"../Supplier/files/'.$image1.'\"</td>
<td> </td>
<tr>
<td> </td>
<td> </td>
</tr>
</table></br>";
Any ideas what I will need?
Thanks,
G