ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:activerecord:find

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:activerecord:find [2016/01/16 22:55] – ↷ Links adapted because of a move operation mnewnhamv5: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(+  array|bool find(
     string $where     string $where
 +    optional string $bindarr=false,
 +    optional string $pkeysArr=false,
 +    optional array $extra=array()
     )     )
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
-This function is part of [[v5:activerecord:activerecord_index#active_records_extended|Extended Active Record]]+This function locates records the match the //**where**// string in any portion of the database record and returns an array of results.  
 + 
 +If no results are returned the method returns false 
 + 
 +It is part of both [[v5:activerecord:activerecord_index#active_records_extended|Extended Active Record]] and [[v5:activerecord:activerecord_index#active_records|Active Record]]
 -------------------------------------- --------------------------------------
 +===== Parameters =====
 +==== $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
 +
 +==== $pkeysArr ====
 +
 +==== $extra ====
 +$extra provides an optional set of parameters
 +
 +|Parameter|Description|
 +|limit| Select Record Limit|
 +|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->find('id=1');+$person->find('birth_date<2019-01-01');
  
 </code> </code>
v5/activerecord/find.1452981323.txt.gz · Last modified: (external edit)