]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 removed all instances of get_fieldset_sql()
authorskodak <skodak>
Sun, 1 Jun 2008 16:17:07 +0000 (16:17 +0000)
committerskodak <skodak>
Sun, 1 Jun 2008 16:17:07 +0000 (16:17 +0000)
lib/dmllib.php
lib/dmllib_todo.php

index aa9ed08ebaabd1c5bffe8ddc466a6dc7bc93992f..d4759d9af438a2eb28f40cf3bf5733abdfda7615 100644 (file)
@@ -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');
+}
index bc3d34ff2085b404041d9d4ce22c843f16747a6a..b8dbf173c101c24b962984e9cc11c756166572aa 100644 (file)
@@ -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() .'<br /><br />'. 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
  *