插入不起作用

时间:2015-03-11 22:25:55

标签: php sql

我试图将一个表从一个表插入另一个表(两个都在同一台服务器上)。更新部分工作正常,但插入部分将正确插入所有字段,但"响应"一。我不明白为什么......

<?php
        $reponse = $_POST['reponse'];
        $id = $donnees['id'];

        // Update
        $req = $bdd->prepare('UPDATE table_commentaires SET reponse=? WHERE id=?');
        $req->execute(array($reponse, $id));

        $req->closeCursor();

        // Transfer
        $req = $bdd->prepare('INSERT INTO table_reponses (id_question, question, reponse, pseudo, date_publication) SELECT id, comm, reponse, pseudo, date_publication FROM table_commentaires WHERE id=?');
        $req->execute(array($id));

        // TODO: Delete from table_commentaires

        $req->closeCursor();
    ?>

0 个答案:

没有答案