Get Started

Where Syntax

Query

Transaction

Advanced

PDO object

Debug

Information

version: 1.1.3

update

Modify data in table

update($table, $data, $where)
Return: [number] The number of rows affected.
Like insert(), you can modify array data without serialization, and you can use [+], [-], [*] and [/] for mathematical operation.
$database->update("account", [
	"type" => "user",

	// All age plus one
	"age[+]" => 1,

	// All level subtract 5
	"level[-]" => 5,

	// All score multiplied by 2
	"score[*]" => 2,

	// Like insert, you can assign the serialization
	"lang" => ["en", "fr", "jp", "cn", "de"],

	"(JSON) fav_lang" => ["en", "fr", "jp", "cn", "de"],

	// You can also assign # for using SQL functions
	"#uid" => "UUID()"
], [
	"user_id[<]" => 1000
]);