Sorry I probably wasn't as clear...I did end up getting this to work by the following:
//*************************************************************************************
//Make server and database connections
//*************************************************************************************
$con = mysql_connect("$server",$userid,$pass)
or die ("Connection Error to Server");
$db = mysql_select_db("$database",$con)
or die("Connection Error to Database");
//local path containing ALL THE RACE PHOTOS ON THE HARD DRIVE!!!
$s = "c:\\phpdev\\www\allraces2";
if (!$s)
{
echo "Error: Must specify a directory to view as readDir.php?s=somedir"; exit;
}
else
{
}
//DIM THE LOCAL FILES PATH ARRAY
$localPics = Array();
//OPEN UP THE allraces DIRECTORY
$handle=opendir($s);
//LOAD THE LOCAL FILE PATH ARRAY UNTIL ALL FILES ARE READ
while (($file = readdir($handle))!==false)
{
if ($file)
{
//LOWERCASE THE FILES, SOME .JPG AND SOME .jpg
$file2 = strtolower($file);
//LOAD ARRAY
$localPics[] = "$file2"."";
}
}
//PHOTOS IN LIVE USE, FILES NAMES STORED INTO MYSQL TABLE
$query = "SELECT photoid from photoids2";
$result = mysql_query($query);
$liverows = mysql_num_rows($result);
//DIM THE ARRAY FOR MYSQL TABLE, THIS TABLES STORES ALL THE PICS THAT ARE LIVE ON THE WEB
$livePics = Array();
//FILL THE ARRAY WITH RESULTS FROM THE MYSQL TABLE
while ($row = mysql_fetch_array($result))
{
$livePics[] = $row[photoid];
}
//get the count of the pics in the localArray
$localRow = count($localPics);
//SET UP THE OUTER LOOP USING THE LIVE PICS AS THE MAIN COUNTER
for($i=0; $i<$liverows; $i++)
{
//SET UP THE INNER LOOP USING THE LOCAL PICS TO CHECK
for ($l=0; $l<$localRow; $l++)
{
if ($livePics[$i] == $localPics[$l])
{
//IF A LIVEPIC MATCHES A LOCAL PIC THEN COPY IT
echo 'copy ' . $localPics[$l] . '<br>';
}
else
{
//echo 'no copy' . $livePics[$i];
}
}
}
May not be the right way, but at least it works!!
I have to make sure that I have checked every single livePic against every possible localPic, if a match is found, do something.