Get Started

Upgrade

Where Syntax

Query

Aggregation

Fetch

Transaction

Management

Advanced

Raw object

PDO object

Debug

Information

version: 2.1.4

avg

Calculate the average value of the column.

avg($table, $column, $where)
avg($table, $join, $column, $where)
Return: [number] The average number of the column.
$average = $database->avg("account", "age", [
	"gender" => "male"
]);

echo "The average age of male user is " . $average;