note 79159 added to function.PDO-sqliteCreateFunction
| From: | nospam dot list at unclassified dot de | Date: | Wed, 14 Nov 2007 00:35:05 +0000 |
| Subject: | note 79159 added to function.PDO-sqliteCreateFunction | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132244@lists.php.net to get a copy of this message | ||
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...)
----
Server IP: 69.147.83.197
Probable Submitter: 88.217.116.155
----
Manual Page -- http://www.php.net/manual/en/function.PDO-sqliteCreateFunction.php
Edit -- https://master.php.net/note/edit/79159
Del: integrated -- https://master.php.net/note/delete/79159/integrated
Del: useless -- https://master.php.net/note/delete/79159/useless
Del: bad code -- https://master.php.net/note/delete/79159/bad+code
Del: spam -- https://master.php.net/note/delete/79159/spam
Del: non-english -- https://master.php.net/note/delete/79159/non-english
Del: in docs -- https://master.php.net/note/delete/79159/in+docs
Del: other reasons-- https://master.php.net/note/delete/79159
Reject -- https://master.php.net/note/reject/79159
Search -- https://master.php.net/manage/user-notes.php