ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:activerecord:save

save

Syntax
bool save()

Description

To insert a new record into the database, change an object's properties and then call the save() method. The method saves a record by executing an INSERT or UPDATE SQL statement as appropriate.

Returns

ValueDescription
0An insert or update was unsuccessful
1An insert or update was successful
-1In the case of an update, and no data was modified

Usage

$person = new person();
$person->name_first = 'Andi';
$person->name_last  = 'Gutmans';
$person->save();
v5/activerecord/save.txt · Last modified: 2016/01/13 02:15 by mnewnham