Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/tests/migrate/count_report.php

27 lines
618 B

<?php
require '../../main/inc/global.inc.php';
$eol = "<br />\n";
if (PHP_SAPI == 'cli') {
$eol = "\n";
}
$tables = array(
'user',
'course',
'session',
'course_rel_user',
'session_rel_course_rel_user',
'gradebook_category',
);
echo "$eol--- Post-migration count report ---$eol";
foreach ($tables as $table) {
$sql = "SELECT count(*) FROM $table";
$res = Database::query($sql);
if ($res === false) {
echo "SQL error in ".$sql.$eol;
} else {
$row = Database::fetch_array($res);
$count = $row[0];
echo "Table $table has $count items after migration$eol";
}
}
echo 'The end.'.$eol;