Q:

SQL insert into select issue

So i think i'm close to figuring this out but my query won't add the item from the "pending" table to the "items" table.  can you guys help me out with this please.  Also if i want it to delete after it gets added should i add the code below the INSERT INTO SELECT query?  thanks
action.php:
$sql = "INSERT INTO items (photo,title,description, name) SELECT  (photo,title,description, name) FROM pending";
$stmt = $conn->prepare($sql); 
$stmt->execute();

Example for delete query after it takes the item from the "pending" into items:
$idToDelete = filter_var($_POST["recordToDelete"],FILTER_SANITIZE_NUMBER_INT); 

//try deleting record using the record ID we received from POST

$sql = "DELETE FROM pending WHERE id = :id";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':id', $idToDelete, PDO::PARAM_INT);   
$stmt->execute();

A:

I think you are leaving yourself open to mistakes doing it this way. 
Consider what would happen if a new row is added to the pending queue after you have issued the INSERT SELECT but before you have started your delete. 
I think you need to do this in a more controlled way inside a single loop to make sure you are only deleting what you have copied from pending into items. 
$sql = "SELECT photo,title,description, name FROM pending";
$select_pending = $conn->prepare($sql); 
$select_pending->execute();

$sql = "INSERT INTO items (photo,title,description, name) 
               VALUES (:photo,:title,:description, :name)";
$insert_items = $conn->prepare($sql); 

$sql = "DELETE FROM pending WHERE id = :id";
$delete_pending = $conn->prepare($sql); 

// only if you are using INNODB databases. 
//$conn->beginTransaction();

while( $row = $select_pending->fetch_object() ) {

    $insert_items->bindParam(':photo',       $row->photo, PDO::PARAM_STR);
    $insert_items->bindParam(':title',       $row->title, PDO::PARAM_STR);
    $insert_items->bindParam(':description', $row->description, PDO::PARAM_STR);
    $insert_items->bindParam(':name',        $row->name, PDO::PARAM_STR);
    $insert_items->execute();

    $delete_pending->bind_param(':id', $row->id, PDO::PARAM_INT);
    $delete_pending->execute();
}

// only if you are using INNODB databases. 
//$conn->commit();

