Ive added this check in other php scripts be for but its not working for some reason now
//Database Connection
$connect = mysql_connect("localhost", "root", "") or die ("Couldnt connect");
$db = mysql_select_db("photos", $connect) or die ("Couldnt open Database");
$check_query = mysql_query("SELECT * FROM Photos WHERE PhotoName='$entry' AND PhotoLocation='$partialPath' ");
$partialPath = addslashes($partialPath);
$entry = addslashes($entry);
$thumbnail = addslashes($thumbnail);
if (mysql_num_rows($check_query) == 0) {
//Insert SQL Statment
$sql = "INSERT INTO Photos SET PhotoName = '$entry', PhotoLocation = '$partialPath', PhotoThumbnail = '$thumbnail'";
$sql_result = mysql_query($sql, $connect) or die ("Could not insert user into database");
echo "<b>Merging:</b> <i>".$partialPath."\\".$entry."</i><br>";
} else {
echo "<b>Already Merged:</b> <i>".$partialPath."\\".$entry."</i><br>";
}
im checking the database for duplicates
if (mysql_num_rows($check_query) == 0) {
now if it returns 0 then go ahead and echo out merigng else echo out already merged
now no matter what I do, it always says merging even though there are records of the same thing in the database already and it will add them making duplicates in the database.. hope this makes sense