From: stronk7 Date: Mon, 30 Oct 2006 18:31:08 +0000 (+0000) Subject: New function sql_substr() returns the proper substr() function for each DB X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=06edab84e16de901a103e0852b462551dec9f74b;p=moodle.git New function sql_substr() returns the proper substr() function for each DB Merged from MOODLE_17_STABLE --- 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.