| @@ -151,9 +151,10 @@ | ||
| 151 | 151 | $results = array(); |
| 152 | 152 | $headers = array(); |
| 153 | 153 | |
| 154 | 154 | // short circuit results for remote dbs. |
| 155 | - if ( false !== ( $remote_results = apply_filters( 'visualizer_db_query_execute', false, $this->_query, $as_html, $results_as_numeric_array, $raw_results, $this->_chart_id, $this->_params ) ) ) { | |
| 155 | + $remote_results = apply_filters( 'visualizer_db_query_execute', false, $this->_query, $as_html, $results_as_numeric_array, $raw_results, $this->_chart_id, $this->_params ); | |
| 156 | + if ( false !== $remote_results ) { | |
| 156 | 157 | $error = $remote_results['error']; |
| 157 | 158 | if ( empty( $error ) ) { |
| 158 | 159 | $results = $remote_results['results']; |
| 159 | 160 | $headers = $remote_results['headers']; |
| @@ -179,9 +180,9 @@ | ||
| 179 | 180 | } |
| 180 | 181 | |
| 181 | 182 | if ( $wpdb->last_error ) { |
| 182 | 183 | $this->_error = $wpdb->last_error; |
| 183 | - return []; | |
| 184 | + return array(); | |
| 184 | 185 | } |
| 185 | 186 | |
| 186 | 187 | if ( $rows ) { |
| 187 | 188 | $results = array(); |
| @@ -197,9 +198,9 @@ | ||
| 197 | 198 | $headers[] = array( 'type' => $this->get_col_type( $col_num++ ), 'label' => $k ); |
| 198 | 199 | } |
| 199 | 200 | } |
| 200 | 201 | $results[] = $result; |
| 201 | - $row_num++; | |
| 202 | + ++$row_num; | |
| 202 | 203 | } |
| 203 | 204 | } |
| 204 | 205 | |
| 205 | 206 | $this->_error = $wpdb->last_error; |