Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : SQLite Functions (PDO_SQLITE) : PDO->sqliteCreateFunction()

PDO->sqliteCreateFunction()

Registers a User Defined Function for use in SQL statements ()

Example 2342. PDO::sqliteCreateFunction() example

<?php
function md5_and_reverse($string)
{
   return
strrev(md5($string));
}

$db = new PDO('sqlite:sqlitedb');
$db->sqliteCreateFunction('md5rev', 'md5_and_reverse', 1);
$rows = $db->query('SELECT md5rev(filename) FROM files')->fetchAll();
?>

Change Language


Follow Navioo On Twitter
PDO_SQLITE DSN
PDO->sqliteCreateAggregate()
PDO->sqliteCreateFunction()
eXTReMe Tracker