v5:reference:connection:getmedian
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
reference:getmedian [2015/07/18 04:06] – created mnewnham | v5:reference:connection:getmedian [2025/10/06 16:38] (current) – mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
~~NOTOC~~ | ~~NOTOC~~ | ||
<WRAP right box> | <WRAP right box> | ||
== 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.1437185187.txt.gz · Last modified: (external edit)