LuckySt
Mitglied
Hallo,
ich hoffe mir kann hier jemand weiter helfen.
Mein Anbieter hat die PHP Version auf 7.1 erhöht und nun bekomme ich folgenden Fehler:
Die Meldung bezieht sich auf
Hoffe Ihr könnt mir wieder helfen.
ich hoffe mir kann hier jemand weiter helfen.
Mein Anbieter hat die PHP Version auf 7.1 erhöht und nun bekomme ich folgenden Fehler:
Fatal error: Uncaught Error: Call to a member function query() on null in /.../statistik_counter_ereignisse.php:31 Stack trace: ... /.../statistik_counter_ereignisse.php on line 31
PHP:
include_once('setting.php');
$jahr = date('Y');
$totals = array('ball'=>0, 'kreis'=>0, 'linie'=>0);
$totalsj = array('ball'=>0, 'kreis'=>0, 'linie'=>0);
$sql1 = "SELECT type, COUNT(*) AS cnt FROM daten GROUP BY type";
foreach ($pdo->query($sql1) as $row)
{
$totals[$row['type']] = $row['cnt'];
}
$sql2 = "SELECT type, COUNT(*) AS cnt FROM daten WHERE year LIKE '".$jahr."' GROUP BY type";
foreach ($pdo->query($sql2) as $row)
{
$totalsj[$row['type']] = $row['cnt'];
}
Die Meldung bezieht sich auf
PHP:
foreach ($pdo->query($sql1) as $row)
Hoffe Ihr könnt mir wieder helfen.