$db->beginTransaction();
$del = $db->prepare('DELETE FROM hesabat_filter WHERE model_id NOT IN (SELECT res_id FROM result)');
$del->execute();
$del = $db->prepare('DELETE FROM hesabat_istilik WHERE model_id NOT IN (SELECT res_id FROM result)');
$del->execute();
$del = $db->prepare('DELETE FROM hesabat_nem WHERE model_id NOT IN (SELECT res_id FROM result)');
$del->execute();
$del = $db->prepare('DELETE FROM hesabat_rek WHERE model_id NOT IN (SELECT res_id FROM result)');
$del->execute();
$del = $db->prepare('DELETE FROM hesabat_soyuqluq WHERE model_id NOT IN (SELECT res_id FROM result)');
$del->execute();
$del = $db->prepare('DELETE FROM hesabat_vent WHERE model_id NOT IN (SELECT res_id FROM result)');
$del->execute();
$db->commit();
$count = $del->rowCount();
echo $count;
この PDO は正しく動作しますが、削除されたすべての行を数えることはできません。準備されたクエリごとに異なる変数を与えてから、変数を収集する必要があると思います。あなたのアイデアは何ですか?