How do I save the largest value in rowCount?

0

I want to save in a variable the largest value ever obtained by rowCount only I do not know how to do logic.

Current query:

$playeronline = $pdoG->prepare("SELECT login FROM u_hero WHERE login = 1");
$playeronline->execute();
$numeroonline = $playeronline->rowCount();
return $numeroonline;
    
asked by anonymous 08.12.2017 / 23:31

1 answer

1

In fact this is not reliable. You should increment your own counter every time someone logs in, and decrement every time someone logs out (manually or by inactivity). When incrementing it compares with the highest historical value and decides whether it is a new record or not.

    
11.12.2017 / 13:28