nested loop confusion
| From: | Jerry Lake | Date: | Thu, 06 Sep 2001 19:57:20 +0000 |
| Subject: | nested loop confusion | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66267@lists.php.net to get a copy of this message | ||
Ok, I will try to explain myself as clearly as possible
please let me know if I need to be more so.
On my admin page I have a review form. there is a select
box that is self populating from a readir. that part works
fine. however I would like for the files to not show up if
they have been used in a prior review, the ones that have been
used are noted in the MySQL review database. here is the
code that I am trying to work with, if anyone has any ideas,
please let me know.
<snip>
<?php
$handle=opendir('/home/upstarter/public_html/images/albums/');
while (false!==($file = readdir($handle)))
{
// new code here
$cExt = explode( ".", $file );
// and here
while($myrow = mysql_fetch_array($result))
{
$image_url = $myrow["image_url"];
$image = explode( "/", $image_url );
if ($file != "." && $file != ".." && $file != $image[2]
&& $cExt[1]
== "gif" || $cExt[1] == "jpg")
{
echo "<option value=\"$file\">".$file."</option>";
}
}
}
echo "</select>";
closedir($handle);
?>
</snip>
Jerry Lake
Interface Engineering Technician