clean.php 577 B

123456789101112
  1. <?php
  2. die();
  3. require '../../main/inc/global.inc.php';
  4. $tables = array('user','course','session','session_rel_course','session_rel_course_rel_user','session_rel_user','c_attendances','track_e_default','user_field_values','course_field_values','session_field_values','course_field','session_field','user_field', 'user_field_options','course_field_options','session_field_options');
  5. foreach ($tables as $table) {
  6. $sql = "TRUNCATE $table";
  7. if ($table == 'user') {
  8. $sql = "DELETE FROM $table WHERE user_id > 2";
  9. }
  10. mysql_query($sql);
  11. }
  12. @system('rm -rf ../../courses/*');