From f5c752f9b36a01124ddfbc1837cde32e43e3df7f Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 1 Jun 2008 16:17:07 +0000 Subject: [PATCH] MDL-14679 removed all instances of get_fieldset_sql() --- lib/dmllib.php | 3 +++ lib/dmllib_todo.php | 49 --------------------------------------------- 2 files changed, 3 insertions(+), 49 deletions(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index aa9ed08eba..d4759d9af4 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -460,3 +460,6 @@ function get_fieldset_select($table, $return, $select) { error('get_fieldset_select() removed'); } +function get_fieldset_sql($sql) { + error('get_fieldset_sql() removed'); +} diff --git a/lib/dmllib_todo.php b/lib/dmllib_todo.php index bc3d34ff20..b8dbf173c1 100644 --- a/lib/dmllib_todo.php +++ b/lib/dmllib_todo.php @@ -662,55 +662,6 @@ function get_field_sql($sql) { } } -/** - * Get an array of data from one or more fields from a database - * use to get a column, or a series of distinct values - * - * @uses $CFG - * @uses $db - * @param string $sql The SQL string you wish to be executed. - * @return mixed|false Returns the value return from the SQL statment or false if an error occured. - * @todo Finish documenting this function - */ -function get_fieldset_sql($sql) { - - global $db, $CFG; - - if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; }; - - $rs = $db->Execute($sql); - if (!$rs) { - debugging($db->ErrorMsg() .'

'. s($sql)); - if (!empty($CFG->dblogerror)) { - $debug=array_shift(debug_backtrace()); - error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $sql"); - } - return false; - } - - if ( !rs_EOF($rs) ) { - $keys = array_keys($rs->fields); - $key0 = $keys[0]; - $results = array(); - while (!$rs->EOF) { - array_push($results, $rs->fields[$key0]); - $rs->MoveNext(); - } - /// DIRTY HACK to retrieve all the ' ' (1 space) fields converted back - /// to '' (empty string) for Oracle. It's the only way to work with - /// all those NOT NULL DEFAULT '' fields until we definetively delete them - if ($CFG->dbfamily == 'oracle') { - array_walk($results, 'onespace2empty'); - } - /// End of DIRTY HACK - rs_close($rs); - return $results; - } else { - rs_close($rs); - return false; - } -} - /** * Delete one or more records from a table * -- 2.39.5