Correction du classement #13

Merged
nemunaire merged 4 commits from fix/classement into master 2021-01-01 20:07:03 +00:00
Showing only changes of commit 4cda71a337 - Show all commits

View File

@ -196,4 +196,14 @@ class BDD
return pg_affected_rows($this->reponse);
}
public function update_classement()
{
if (!$this->session) {
return false;
}
global $table_user;
$query = "UPDATE $table_user SET place_points=subquery.rn FROM (SELECT id, points, place_points, row_number() over (order by points DESC) as rn FROM $table_user) AS subquery WHERE $table_user.id=subquery.id;";
pg_query($this->session, $query);
}
}