Function DatabaseDriver->db_function
Definitions
sources/database.php
- Call a database function that may be different on different database drivers.We are using MySQL syntax as a de facto standard. SQL does not standardise this stuff well.Basic arithmetic and inequality operators are assumed supported without needing a function.Note that AVG may return an integer or float, depending on whether the DB engine auto-converts round numbers to integers. MySQL seems to.Note that we are hard-coding for different database drivers in here, as it is easier to maintain the code and reference possibilities in one place.Database drivers can still override this whole method if they need to.Remember to add a test to the database_misc.php test.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Return: string
Parameters
Name | Type | Default | Set | Range | Description |
---|---|---|---|---|---|
$function | string | required parameter | N/A | N/A | Function name |
$args | array | [] | N/A | N/A | List of string arguments, assumed already quoted/escaped correctly for the particular database |
Return
- SQL fragment (null: not supported)
- Type: ?string
- Set: N/A
- Range: N/A