ok I have another little problem, this is my first time using odbc in php, how do I check to see if the data already exists?
<?
function getDirList ($dirName) {
$d = dir($dirName);
while($entry = $d->read()) {
if ($entry != "." && $entry != ".." && $entry != "index.php" && $entry != "cfg.php") {
if (is_dir($dirName."\\".$entry)) {
getDirList($dirName."\\".$entry);
} else {
$basePath = "C:\\Inetpub\\wwwroot\\photolab\\";
$partialPath = substr($dirName,strlen($basePath), strlen($dirName) - strlen($basePath));
//Database Connection
$connect = odbc_connect("PHOTOS", "root", "");
$check_query = odbc_exec($connect,"select * from Photobase where PhotoName = $entry and PhotoLocation = $partialPath");
//Check to see if data exists in database
if (odbc_num_rows($check_query) != 0) {
echo "Merging: ".$partialPath."\\".$entry."<br>";
$resultupdate=odbc_exec($connect,"INSERT INTO Photobase(PhotoName,PhotoLocation) values('$entry','$partialPath')");
} else {
echo "Already in Database: ".$partialPath."\\".$entry."<br>";
}
}
}
}
$d->close();
}
getDirList("C:\\Inetpub\\wwwroot\\photolab");
?>
if (odbc_num_rows($check_query) != 0) {
doesnt work