note 71166 deleted from function.pdo-sqlitecreateaggregate by didou
| From: | didou@php.net | Date: | Fri, 02 Feb 2007 00:21:53 +0000 |
| Subject: | note 71166 deleted from function.pdo-sqlitecreateaggregate by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122497@lists.php.net to get a copy of this message | ||
Note Submitter: Ben Karel
----
If you try it out, the code example given here doesn't actually work. The PDO
sqliteCreateAggregate() function requires a different method prototype for the step function than
does sqlite_create_aggregate().
Instead of
<?php
function max_len_step(&$context, $string)
{
if (strlen($string) > $context) {
$context = strlen($string);
}
}
?>
the function needs to be
<?php
function max_len_step(&$context, $rownum, $string)
{
if (strlen($string) > $context) {
$context = strlen($string);
}
return $context;
}
?>