lib/datalib.php - fixed missing return and global $CFG

Tidyup after merging Tim Hunt's patches.
This commit is contained in:
martinlanghoff
2006-01-16 06:35:58 +00:00
parent 89c870e7b2
commit 18147bc254
+2 -3
View File
@@ -715,15 +715,13 @@ function get_recordset_select($table, $select='', $sort='', $fields='*', $limitf
*/
function get_recordset_list($table, $field='', $values='', $sort='', $fields='*', $limitfrom='', $limitnum='') {
global $CFG;
if ($field) {
$select = "$field IN ($values)";
} else {
$select = '';
}
get_recordset_select($table, $select, $sort, $fields, $limitfrom, $limitnum);
return get_recordset_select($table, $select, $sort, $fields, $limitfrom, $limitnum);
}
/**
@@ -953,6 +951,7 @@ function get_records_sql_menu($sql) {
*/
function get_field($table, $return, $field1, $value1, $field2='', $value2='', $field3='', $value3='') {
global $CFG;
$select = where_clause($field1, $value1, $field2, $value2, $field3, $value3);
$rs = get_recordset_sql('SELECT ' . $return . ' FROM ' . $CFG->prefix . $table . ' ' . $select);