tb_lp_sessions; $limit = 100; $result = $this->wpdb->query( " DELETE FROM {$table} {$where} LIMIT {$limit} " ); $this->check_execute_has_error(); return $result; } public function count_row_db_sessions() { global $wpdb; $now = current_time( 'timestamp' ); $adayago = $now - ( 24 * 60 * 60 ); $where = 'WHERE session_expiry < ' . $adayago . ' AND 0=%d'; $query = $wpdb->prepare( " SELECT count(*) FROM $this->tb_lp_sessions {$where} ", 0 ); $result = $wpdb->get_var( $query ); return $result; } } LP_Sessions_DB::getInstance();