私はCMSに取り組んでいて、バックアップ/復元機能を追加したいと思っていました。保存したエントリを編集するたびにバックアップして、クライアントが変更を加えた場合に不満を感じたり、何かを台無しにしたりした場合に、元に戻って以前の状態を選択して復元できるようにします。
私が抱えている問題は、この機能をコーディングするという概念に頭を悩ませようとしていることです。「ID、日付、時刻、pageName、およびpageContent」フィールドを使用して「backup」という新しいテーブルを作成しましたが、そこから先に進むと行き詰まります。
複製をバックアップテーブルに保存する新しいクエリを編集スクリプトに追加しますか?そして、保存されたいくつかの編集ごとにのみバックアップするようにするにはどうすればよいですか?
ここに、保存編集クエリがあります。前もって感謝します!:)
<?php
$_POST['entry'] = mysql_real_escape_string($_POST['entry']);
$sql="update pageEntry set entry=\"$_POST[entry]\", pageName=\"$_POST[pageName]\" where id=\"$_POST[id]\"";
$result=mysql_query($sql)or die('Bad Query');
echo "<div id='edit2'>The file has been uploaded, and your information has been added to the directory<br /></div>";
?>