Analyse last days

time interval 30SELECT `Close Date` Date, `Gross P/L` FROM (SELECT DATE(`Close Date`) `Close Date`, SUM(`Gross P/L`) `Gross P/L` FROM Forex.Dukas_positions GROUP BY `Close Date` ORDER BY `Close Date`) sub WHERE `Close Date` > SUBDATE(CURDATE(), 30) GROUP BY `Close Date` ORDER BY `Close Date`
Notice: Undefined variable: mysqli in /var/www/html/dukas/index.php on line 87

Fatal error: Uncaught Error: Call to a member function query() on null in /var/www/html/dukas/index.php:87 Stack trace: #0 {main} thrown in /var/www/html/dukas/index.php on line 87