v5:reference:connection:day
Differences
This shows you the differences between two versions of the page.
v5:reference:connection:day [2016/04/11 00:12] – created mnewnham | v5:reference:connection:day [2016/04/11 00:18] (current) – mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
~~NOTOC~~ | ~~NOTOC~~ | ||
<WRAP right box> | <WRAP right box> | ||
**From Version 5.21.0-beta-2** | **From Version 5.21.0-beta-2** | ||
== See Also == | == See Also == | ||
- | [[v5: | + | [[v5: |
[[v5: | [[v5: | ||
== Syntax == | == Syntax == | ||
- | string | + | string |
string $fieldName, | string $fieldName, | ||
) | ) | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | The method '' | + | The method '' |
===== Parameters ===== | ===== Parameters ===== | ||
==== $fieldName ==== | ==== $fieldName ==== | ||
Line 19: | Line 19: | ||
-------------------------------- | -------------------------------- | ||
===== Usage ===== | ===== Usage ===== | ||
- | In the following example, we are analyzing hire patterns by month of hire date | + | In the following example, we analyze the most often occurring |
+ | day of the month for a birth date | ||
<code php> | <code php> | ||
- | $sql = " | + | $sql = " |
FROM employees | FROM employees | ||
- | ORDER BY {$db->month('hire_date' | + | |
- | $data = $db->getAssoc($sql); | + | |
+ | $data = $db->getRow($sql); | ||
/* | /* | ||
- | * Returns | + | * Returns |
+ | * day of the month | ||
+ | */ | ||
+ | |||
+ | array(0=> | ||
+ | | ||
- | array(01=> | ||
- | 02=>7, | ||
- | 03=>16, | ||
- | 06=>56, | ||
- | 07=>32, | ||
- | 08=>20, | ||
- | 09=>10, | ||
- | 10=>16, | ||
- | 12=>5) | ||
*/ | */ | ||
</ | </ | ||
- |
v5/reference/connection/day.txt · Last modified: 2016/04/11 00:18 by mnewnham