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
v5:activerecord:find [2019/01/04 05:15] 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 $bindarr=false,
Line 11: Line 11:
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
-This function is part of both [[v5:activerecord:activerecord_index#active_records_extended|Extended Active Record]] and [[v5:activerecord:activerecord_index#active_records|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 ===== ===== 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->find('id=1');+$person->find('birth_date<2019-01-01');
  
 </code> </code>
v5/activerecord/find.txt · Last modified: by mnewnham