Home > PHP > Function > SQLite > SQLiteDatabase->createFunction()

SQLiteDatabase->createFunction()

SQLiteDatabase->createFunction - Registers a "regular" User Defined Function for use in SQL statements

Syntax

void SQLiteDatabase->createFunction (resource $dbhandle, string $function_name, callback $callback, int $num_args, string $function_name, callback $callback, int $num_args, resource $dbhandle, string $function_name, callback $callback, int $num_args, string $function_name, callback $callback, int $num_args)

Arguments

  • dbhandle - The SQLite Database resource; returned from sqlite_open() when used procedurally. This parameter is not required when using the object-oriented method.
  • function_name - The name of the function used in SQL statements.
  • callback - Callback function to handle the defined SQL function. Note: Callback functions should return a type understood by SQLite (i.e. scalar type).
  • num_args - Hint to the SQLite parser if the callback function accepts a predetermined number of arguments.
  • function_name
  • callback
  • num_args
  • dbhandle - The SQLite Database resource; returned from sqlite_open() when used procedurally. This parameter is not required when using the object-oriented method.
  • function_name - The name of the function used in SQL statements.
  • callback - Callback function to handle the defined SQL function. Note: Callback functions should return a type understood by SQLite (i.e. scalar type).
  • num_args - Hint to the SQLite parser if the callback function accepts a predetermined number of arguments.
  • function_name
  • callback
  • num_args

Description

Object oriented style (method):

Version

PHP 5, sqlite >= 1.0.0

Return value

No value is returned.