v5:activerecord:find
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| v5:activerecord:find [2019/01/04 05:15] – mnewnham | v5:activerecord:find [2025/10/05 02:20] (current) – mnewnham | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== find====== | + | ====== find ====== |
| ~~NOTOC~~ | ~~NOTOC~~ | ||
| <WRAP right box> | <WRAP right box> | ||
| == Syntax == | == Syntax == | ||
| - | bool find( | + | |
| string $where | string $where | ||
| optional string $bindarr=false, | optional string $bindarr=false, | ||
| Line 11: | Line 11: | ||
| </ | </ | ||
| ===== Description ===== | ===== Description ===== | ||
| - | This function is part of both [[v5: | + | This function |
| + | |||
| + | If no results are returned the method returns false | ||
| + | |||
| + | It is part of both [[v5: | ||
| -------------------------------------- | -------------------------------------- | ||
| ===== Parameters ===== | ===== Parameters ===== | ||
| - | ====== $where ====== | + | ==== $where ==== |
| + | An SQL string (not including WHERE to match a subset of records | ||
| + | ==== $bindarr ==== | ||
| + | An optional array of bind variables if required by the where statement | ||
| - | ====== $bindarr ====== | + | ==== $pkeysArr |
| - | ====== $pkeysArr ====== | + | ==== $extra ==== |
| - | + | ||
| - | ====== $extra | + | |
| $extra provides an optional set of parameters | $extra provides an optional set of parameters | ||
| + | |||
| |Parameter|Description| | |Parameter|Description| | ||
| |limit| Select Record Limit| | |limit| Select Record Limit| | ||
| |offset| Select Record Offset| | |offset| Select Record Offset| | ||
| ===== Usage ===== | ===== Usage ===== | ||
| + | This example finds all entries in the persons table whose birth date is less than 2019-01-01 | ||
| <code php> | <code php> | ||
| $person = new Person; | $person = new Person; | ||
| - | $person-> | + | $person-> |
| </ | </ | ||
v5/activerecord/find.1546575318.txt.gz · Last modified: by mnewnham
