Execute("select * from sondage"); while ($dsondage=$sondage->FetchNextObject(false)) { if ($date_courante > strtotime($dsondage->date_fin)) { //destruction des données dans la base $connect->Execute('DELETE FROM sondage LEFT INNER JOIN sujet_studs ON sujet_studs.id_sondage = sondage.id_sondage '. 'LEFT INNER JOIN user_studs ON user_studs.id_sondage = sondage.id_sondage ' . 'LEFT INNER JOIN comments ON comments.id_sondage = sondage.id_sondage ' . "WHERE id_sondage = '$dsondage->id_sondage' "); // ecriture des traces dans le fichier de logs error_log($date . " SUPPRESSION: $dsondage->id_sondage\t$dsondage->format\t$dsondage->nom_admin\t$dsondage->mail_admin\n", '../admin/logs_studs.txt'); } }