When you mark a variable a static, what you're doing is making it available from outside the class without instantiation of the class. For example:
class Test {
static $someVariable = 0;
}
Now you can call that variable like so:
echo Test::$someVariable;
If you made an instance of the class and incremented the variable, then called the variable on the original class, it would remain 0. Like this:
$instance = new Test();
$instance->someVariable++;
// This is now 1
echo $instance->someVariable;
// This remains 0
echo Test::$someVariable;
If you had another variable that wasn't marked static, you couldn't call it from outside the class without instantiation. For example:
class Test {
public $differentVariable = 3;
}
echo Test::$differentVariable;
This will not run and give an error.
The confusion here is in how to use static, and how to make the data in your program persist.
Since you're using this on a website where you're loading this script from another page, every time it's called it's run and $overall is reset to 0. If you want that number to be incremented and persist (retain its value even after the user returns to another page), you have a couple of good options. You can learn about and use $_SESSION. (place session_start(); on each PHP page you wish to have the $_SESSION variable available and then store information in it as you would any other associative array)
You can also learn how to use mysqli or some other database interface. This all depends on your overall program design, as the database information will persist permanently or until manually reset, and the $_SESSION data will live only as long as the cookie exists in the user's browser.
Hope that helps!