v5:activerecord:save
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
activerecord:save [2015/12/05 02:05] – created mnewnham | activerecord:save [2015/12/05 02:09] – mnewnham | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== Description ===== | ===== Description ===== | ||
To insert a new record into the database, change an object' | To insert a new record into the database, change an object' | ||
+ | The method saves a record by executing an INSERT or UPDATE SQL statement as appropriate. | ||
+ | |||
+ | Returns false on unsuccessful INSERT, true if successsful INSERT. | ||
+ | |||
+ | Returns 0 on failed UPDATE, and 1 on UPDATE if data has changed, and -1 if no data was changed, so no UPDATE statement was executed. | ||
+ | |||
===== Usage ===== | ===== Usage ===== | ||
<code php> | <code php> |
v5/activerecord/save.txt · Last modified: 2016/01/13 02:15 by mnewnham