Ben böyle yapamam neden?
<?php
class core {
public static $db;
function __construct() {
$this->db = new mysql('host', 'user', 'pw', 'db');
}
}
class stat extends core {
public static function log() {
core::$db->query("insert into mytable values(now())");
}
}
// do something
stat::log();
?>