From 06edab84e16de901a103e0852b462551dec9f74b Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 30 Oct 2006 18:31:08 +0000 Subject: [PATCH] New function sql_substr() returns the proper substr() function for each DB Merged from MOODLE_17_STABLE --- lib/dmllib.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/dmllib.php b/lib/dmllib.php index a7bcd45365..484b576ac2 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -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. -- 2.39.5