コメントのステータスを変更して(読み取りと読み取り/書き込みを無効にする)50Kレコードを更新する必要があり、SQLステートメントが正しいことを確認したい:
$query = "UPDATE node.nid AS nid, node.comment AS node_comment, node.type AS node_type
SET node.comment = '0'
WHERE (node.type in ('article', 'blog', 'event'))
AND (node.comment in ('1','2'))";
$total = 0;
$count = 0;
while ($query_result = db_query($query)){
$count++;
$total++;
if($count>200){
$count = 0;
sleep(300);
}
}
echo "Updated records:" . $total;
サーバーを強制終了しないように、そこに定期的な一時停止を追加しました。これは大丈夫ですか?