]> git.mjollnir.org Git - moodle.git/commitdiff
New function sql_substr() returns the proper substr() function for each DB
authorstronk7 <stronk7>
Mon, 30 Oct 2006 18:31:08 +0000 (18:31 +0000)
committerstronk7 <stronk7>
Mon, 30 Oct 2006 18:31:08 +0000 (18:31 +0000)
Merged from MOODLE_17_STABLE

lib/dmllib.php

index a7bcd4536515593a5aa4c744c3587789c966ec72..484b576ac20a7b7b41651d41e6586f0be9e5aef4 100644 (file)
@@ -1570,6 +1570,17 @@ function sql_as() {
     }
 }
 
+/**
+ * Returns the proper substr() function for each DB
+ * Relies on ADOdb $db->substr property
+ */
+function sql_substr() {
+
+    global $db;
+
+    return $db->substr;
+}
+
 /**
  * Returns the SQL text to be used to order by one TEXT (clob) column, because
  * some RDBMS doesn't support direct ordering of such fields.