getManager(); $db_prefix = api_get_configuration_value('db_prefix') ? api_get_configuration_value('db_prefix') : 'chamilo_'; $db_c_prefix = api_get_configuration_value('table_prefix') ? api_get_configuration_value('table_prefix') : 'crs_'; switch ($action) { case 'check_crs_tables': if (empty($dbName)) { echo 0; break; } $countOfTables = $manager ->getConnection() ->executeQuery("SHOW TABLES LIKE '$db_c_prefix$db_prefix%'") ->rowCount(); echo $countOfTables; break; case 'remove_crs_tables': $statement = $manager ->getConnection() ->executeQuery("SHOW TABLES LIKE '$db_c_prefix$db_prefix%'"); while ($table = $statement->fetch(PDO::FETCH_NUM)) { $manager->getConnection()->executeQuery("DROP TABLE {$table[0]}"); } break; default: break; }