MDL-15132 fixed broken sql menu functions - thanks Howard

This commit is contained in:
skodak 2008-06-04 09:14:17 +00:00
parent 4c14345543
commit ce7fbdb8de

View File

@ -692,8 +692,9 @@ abstract class moodle_database {
$menu = array();
if ($records = $this->get_records_select($table, $select, $params, $sort, $fields, $limitfrom, $limitnum)) {
foreach ($records as $record) {
$key = array_unshift($record);
$value = array_unshift($record);
$record = (array)$record;
$key = array_shift($record);
$value = array_shift($record);
$menu[$key] = $value;
}
}
@ -716,8 +717,9 @@ abstract class moodle_database {
$menu = array();
if ($records = $this->get_records_sql($sql, $params, $limitfrom, $limitnum)) {
foreach ($records as $record) {
$key = array_unshift($record);
$value = array_unshift($record);
$record = (array)$record;
$key = array_shift($record);
$value = array_shift($record);
$menu[$key] = $value;
}
}