v5:activerecord:active_record_tutorial
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
v5:activerecord:active_record_tutorial [2016/01/13 02:15] – ↷ Links adapted because of a move operation mnewnham | v5:activerecord:active_record_tutorial [2022/06/09 18:37] (current) – ↷ Links adapted because of a move operation 3.83.52.90 | ||
---|---|---|---|
Line 132: | Line 132: | ||
$person = new person(); | $person = new person(); | ||
- | ===== Using $ADODB_ASSOC_CASE ==== | + | ===== Using ADODB_ASSOC_CASE ==== |
- | You can use [[reference: | + | |
+ | You can define the [[v5:reference:adodb_assoc_case]] constant | ||
<code php> | <code php> | ||
- | $ADODB_ASSOC_CASE | + | define(' |
+ | require " | ||
$person = new person(' | $person = new person(' | ||
$person-> | $person-> | ||
- | $ADODB_ASSOC_CASE | + | |
+ | define(' | ||
+ | require " | ||
$person2 = new person(' | $person2 = new person(' | ||
$person2-> | $person2-> | ||
Line 162: | Line 166: | ||
<WRAP right box 200px> | <WRAP right box 200px> | ||
== More Information == | == More Information == | ||
- | For more information on bind variables, see [[reference: | + | For more information on bind variables, see [[v5:reference:connection:execute]] |
</ | </ | ||
===== Loading Individual Records ===== | ===== Loading Individual Records ===== | ||
Line 200: | Line 204: | ||
</ | </ | ||
- | The ADOConnection:: | + | The ADOConnection:: |
===== Converting a recordset to an Active Record object ===== | ===== Converting a recordset to an Active Record object ===== | ||
Line 250: | Line 254: | ||
===== Retrieval of Auto-incrementing ID ===== | ===== Retrieval of Auto-incrementing ID ===== | ||
- | When creating a new record, the retrieval of the last auto-incrementing ID is not reliable for databases that do not support the [[reference: | + | When creating a new record, the retrieval of the last auto-incrementing ID is not reliable for databases that do not support the [[v5:reference:connection: |
SELECT MAX($primarykey) FROM $table | SELECT MAX($primarykey) FROM $table | ||
Line 280: | Line 284: | ||
$rec = new ADOdb_Active_Record(" | $rec = new ADOdb_Active_Record(" | ||
- | You can now give a named label in [[v5: | + | You can now give a named label in [[v5: |
<code php> | <code php> | ||
Line 318: | Line 322: | ||
===== Transactions ===== | ===== Transactions ===== | ||
<WRAP right box 200px> | <WRAP right box 200px> | ||
- | More about [[v5: | + | More about [[v5: |
</ | </ | ||
The default transaction mode in ADOdb is autocommit. So that is the default with active record too. The general rules for managing transactions still apply. Active Record to the database is a set of insert/ | The default transaction mode in ADOdb is autocommit. So that is the default with active record too. The general rules for managing transactions still apply. Active Record to the database is a set of insert/ |
v5/activerecord/active_record_tutorial.1452647753.txt.gz · Last modified: 2017/04/21 11:22 (external edit)