DB にコメントを追加するこの PHP/MySQL スクリプトがあります。
$SQL = "INSERT INTO blog_comments (article_id, author_name, comment, path, posted, status) ";
$SQL .= "VALUES (:article_id, :name, :comment, :next_path, Now(), 'Live');";
$STH = $DBH->prepare($SQL);
$STH->bindParam(':article_id', $article_id);
$STH->bindParam(':name', $name);
$STH->bindParam(':comment', $comment);
$STH->bindParam(':next_path', $next_path);
$STH->execute();
[author_name]
これを変更して、同じ,[article_id]
を[comment]
このテーブルに挿入しないようにする方法はありますか? テーブルにUNIQUE を追加することで 1 つの列が可能であることはわかっていますが、複数の列についてはわかりません。