I am sorry if this has been asked but I can't find anything that can help me. I am trying to switch the values of two primary keys in my table as in 1 becomes 2 and 2 becomes 1 .
I am receiving this error 
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY 

I am not very familiar with mysql. How would you solve this problem

```
<?php
//Connect to the DB
require_once('connect.php');
//insert names into the DB
$MoveToTwo = '2';
$MoveToOne = '1';

try{
    global $db;
    $inserts = $db->prepare("UPDATE slider_images SET id=:MoveToOne WHERE id=:MoveToTwo");
    $inserts = $db->prepare("UPDATE slider_images SET id=:MoveToTwo WHERE id=:MoveToOne");
    $inserts->bindParam(':MoveToOne', $MoveToOne);
    $inserts->bindParam(':MoveToTwo', $MoveToTwo);
    $inserts->execute();
}

catch(Exception $e){
    echo $e->getMessage();
    exit;
}
?>

```