Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once 'include/class.Settings.php';
- class MonthlySums{
- protected static $dbh;
- public function __construct() {
- $user = Settings::$db['user'];
- $pass = Settings::$db['password'];
- $dsn = 'mysql:host=' . Settings::$db['host'] . ';dbname=' . Settings::$db['db'];
- try {
- self::$dbh = new PDO($dsn, $user, $pass);
- } catch(PDOException $e) {
- die("Error! : " . $e->getMessage());
- }
- }
- public static function get($init_id) {
- $sql = "SELECT `year`, `month`, `gains_monthly_sum` FROM `fxs_gain_sums` WHERE `init_id` = '$init_id'";
- $resultats = MonthlySums::$dbh->query($sql);
- var_dump($resultats);
- }
- }
- Fatal error: Call to a member function query() on a non-object in /home/fxscript/public_html/gainlosssums.php on line 45
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement