v5:reference:connection:getmedian
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| v5:reference:getmedian [2016/01/13 02:30] – ↷ Page moved from reference:getmedian to v5:reference:getmedian mnewnham | v5:reference:connection:getmedian [2025/10/06 16:38] (current) – mnewnham | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| == Syntax == | == Syntax == | ||
| mixed getMedian { | mixed getMedian { | ||
| - | | + | string $table |
| - | mixed string $column | + | |
| - | | + | |
| } | } | ||
| </ | </ | ||
| + | The method getMedian() does not return a true [[https:// | ||
| - | Returns | + | If the number |
| - | The $where clause is optional, but if used, the WHERE statement must include the requested column | + | Because the method does not perform an arithmetic operation on the returned data, it can be used on character fields |
| + | |||
| + | |||
| + | The $where clause is optional, but if used, the WHERE statement must begin with the keyword // | ||
| + | |||
| + | If an error occurs or a median row cannot be determined (for example the table is empty), false is returned. | ||
| + | ------------------------------ | ||
| ==== Usage ==== | ==== Usage ==== | ||
| <code php> | <code php> | ||
| Line 22: | Line 29: | ||
| $table = ' | $table = ' | ||
| $column = ' | $column = ' | ||
| + | $where | ||
| + | |||
| + | $medianPopulation = $db-> | ||
| - | $medianPopulation = $db-> | ||
| </ | </ | ||
v5/reference/connection/getmedian.1452648655.txt.gz · Last modified: (external edit)
