Read all images from subdirectories
Posted: Wed May 27, 2009 2:14 pm
Hi can someone tell me how I can make this script to show all images that are found in a bunch of subdirectorie.
Presentely it only reads from the SEArchive and display only images that are false in mysql database
Presentely it only reads from the SEArchive and display only images that are false in mysql database
Code: Select all
<?PHP
mysql_connect("localhost", "ixxx_jxxx", "xxx") or die(mysql_error());
mysql_select_db("xxxx") or die(mysql_error());
$sql = "SELECT * FROM `ihsreg` WHERE approve!='TRUE' ORDER BY `Bloom_Name` ASC";
$results = mysql_query($sql);
$column = 1;
print "<table>";
while(($row = mysql_fetch_assoc($results)) !== false) {
if ($column == 1) {
print "<tr>";
}
print '
<td>
<a href="http://www.Mysite/approvalpending/RegPending1.php?search=' . $row['Bloom_Name'] . '">
<img src="http://www.Mysite/SEArchive/' . $row['Bloom_Name'] . '.jpg" width="130" height="130" border="0">
<BR></a>' .$row['Bloom_Name'] . '
</td>';
if ($column == 6) {
print "</tr>";
$column = 0;
}
$column++;
}
if ($column < 5) {
while ($column < 5) {
$column++;
echo "
<td> </td>";
}
echo "</tr>";
}
print "</table>";