Get Started

Upgrade

Where Syntax

Query

Aggregation

Fetch

Transaction

Management

Advanced

Raw object

PDO object

Debug

Information

version: 2.1.12

avg

Calculate the average value of the column.

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

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