From d0d0cd9c7fb931e6f70b646a556e644c51236132 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 10 Mar 2005 14:13:26 +0000 Subject: [PATCH] You can now specify fields to get_record --- lib/datalib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/datalib.php b/lib/datalib.php index 31aa577f413..d5a72d2397d 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -540,7 +540,7 @@ function count_records_sql($sql) { * @return object(fieldset) A fieldset object containing the first record selected * @todo Isn't the return from this function an associative array (array type) ? */ -function get_record($table, $field1, $value1, $field2='', $value2='', $field3='', $value3='') { +function get_record($table, $field1, $value1, $field2='', $value2='', $field3='', $value3='', $fields='*') { global $CFG ; @@ -553,7 +553,7 @@ function get_record($table, $field1, $value1, $field2='', $value2='', $field3='' } } - return get_record_sql('SELECT * FROM '. $CFG->prefix . $table .' '. $select); + return get_record_sql('SELECT '.$fields.' FROM '. $CFG->prefix . $table .' '. $select); } /**