DATA Methods

write()

Write data to database table.

int write( string table, array values [, string where = false ])

Return

Number of updated records.

Parameter
Description
tableThe table name.
valuesArray containing data to be written to table.
whereSQL where statement without the SQL keyword WHERE. If left empty, one record will be appended. If TRUE, all records will be updated.

Append record

$EXEC->data->write("data_test", array("test_int" => 5))
RETURN: 1

Append another record

$DATA->write("data_test", array("test_int" => 5))
RETURN: 1

Update selected records

$DATA->write("data_test", array("test_char" => "foo", "test_text" => "bar"), "test_int = 5")
RETURN: 2

Update all records

$DATA->write("data_test", array("test_char" => "foobar"), true)
RETURN: 4