setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); $stmt=$conn->prepare("INSERT INTO oggetti (nome,descrizione,descrizione_lunga,categoria_id) VALUES (?,?,?,?)"); $stmt->execute(array($_POST['nome'],$_POST['descrizione'],$_POST['descrizione_lunga'],$_POST['categoria_id'])); $id=$conn->lastInsertId(); header("Location: http://localhost/~amato/inserimento4-conferma.php?id=$id"); ?>