I am trying to prevent a duplicate entry into my database. I have two select boxes on a form that are populated from two tables category and publisher. Using the UPDATE method below it duplicates the entry if I send the same value to the database. What changes can I make so entries are not duplicated when updated?
$sqlQuery = "UPDATE records
INNER JOIN category ON category.catID = records.catID
INNER JOIN publisher ON publisher.pubID = records.pubID
SET title=$title, year=$year, desc=$desc, price=$price, pub=$pub
WHERE recID=$recID";
$stmt = $dbConn->prepare($sqlQuery);
$stmt->execute(array($sqlQuery));