v5:activerecord:active_record_tutorial
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
activerecord:active_record_tutorial [2015/12/08 05:17] – [tableKeyHasMany] mnewnham | v5:activerecord:active_record_tutorial [2016/01/13 02:15] – ↷ Page moved from activerecord:active_record_tutorial to v5:activerecord:active_record_tutorial mnewnham | ||
---|---|---|---|
Line 58: | Line 58: | ||
<WRAP right box round> | <WRAP right box round> | ||
== See Also == | == See Also == | ||
- | [[userguide: | + | [[v5:userguide: |
</ | </ | ||
===== Inserting and Updating a Record ===== | ===== Inserting and Updating a Record ===== | ||
Line 78: | Line 78: | ||
1048: Column ' | 1048: Column ' | ||
- | This error occurred because MySQL rejected the INSERT | + | This error occurred because MySQL rejected the INSERT |
To insert a new ADOdb_Active_Record in the database, populate all of ADOdb_Active_Record' | To insert a new ADOdb_Active_Record in the database, populate all of ADOdb_Active_Record' | ||
Line 190: | Line 190: | ||
===== Error Handling and Debugging ===== | ===== Error Handling and Debugging ===== | ||
- | The ADOdb Active Record can be used in conjunction with [[userguide: | + | The ADOdb Active Record can be used in conjunction with [[v5:userguide: |
<code php> | <code php> | ||
Line 318: | Line 318: | ||
===== Transactions ===== | ===== Transactions ===== | ||
<WRAP right box 200px> | <WRAP right box 200px> | ||
- | More about [[reference: | + | More about [[v5:reference:index# |
</ | </ | ||
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/ | ||
Line 337: | Line 337: | ||
===== ClassHasMany ===== | ===== ClassHasMany ===== | ||
- | To globally define a one-to-many relationship we use the static function | + | To globally define a one-to-many relationship we use the static function |
<code php> | <code php> | ||
Line 408: | Line 408: | ||
var_dump($p-> | var_dump($p-> | ||
</ | </ | ||
- | The solution to the above is to unset($p-> | + | The solution to the above is to |
+ | | ||
+ | before | ||
+ | | ||
===== TableHasMany ===== | ===== TableHasMany ===== | ||
Line 455: | Line 458: | ||
echo "OK Loaded HasMany< | echo "OK Loaded HasMany< | ||
else { | else { | ||
- | echo "Error loading hasMany should have 3 array elements Jill Joan Jamie< | + | echo "Error loading hasMany should have |
+ | | ||
} | } | ||
</ | </ |
v5/activerecord/active_record_tutorial.txt · Last modified: 2022/06/09 18:37 by 3.83.52.90