ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:activerecord:replace

Differences

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

Link to this comparison view

Last revisionBoth sides next revision
activerecord:replace [2015/12/05 02:08] – created mnewnhamactiverecord:replace [2015/12/05 18:10] mnewnham
Line 6: Line 6:
 ===== Description ===== ===== Description =====
 ADOdb supports replace functionality, whereby the record is inserted if it does not exists, or updated otherwise. ADOdb supports replace functionality, whereby the record is inserted if it does not exists, or updated otherwise.
 +===== Returns =====
 +The method returns
 +^Value^Description^
 +|0|failure|
 +|1|update|
 +|2|insert|
 +
 ===== Usage ===== ===== Usage =====
 <code php> <code php>
-$person->replace();+$rec = new ADOdb_Active_Record("product"); 
 +$rec->name = 'John'; 
 +$rec->tel_no = '34111145'; 
 +$ok = $rec->replace(); 
 +ADOdb_Active_Record::Load($where)
 </code> </code>
v5/activerecord/replace.txt · Last modified: 2016/01/13 02:15 by mnewnham