note 79159 deleted from function.PDO-sqliteCreateFunction by tularis
| From: | tularis@php.net | Date: | Sun, 29 Jun 2008 21:22:45 +0000 |
| Subject: | note 79159 deleted from function.PDO-sqliteCreateFunction by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140987@lists.php.net to get a copy of this message | ||
Note Submitter: nospam dot list at unclassified dot de
Reason: 1
----
A good example of a user-defined function in SQLite might be a Unicode-aware LOWER() function.
SQLite doesn't come with one because it would make the code much larger. Their rationale is
that if you need such a function, you're likely to have one in your environment that you can
include into SQLite. And here's how it works:
<?php
function SqliteLower($str)
{
return mb_strtolower($str, 'UTF-8');
}
$pdo->sqliteCreateFunction('LOWER', 'SqliteLower', 1);
?>
(Easy integration of user-defined functions from whatever programming language you use SQLite from
is one of the things I like most about SQLite...)