From 75596f601c5a37632f37b882787d3756842b2b90 Mon Sep 17 00:00:00 2001 From: Alex Standiford Date: Tue, 15 Oct 2019 07:46:30 -0400 Subject: [PATCH 1/3] Adds support to fetch all fields in get_results. #10 --- query.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/query.php b/query.php index 6f1e497..15529fd 100644 --- a/query.php +++ b/query.php @@ -2791,6 +2791,11 @@ public function get_results( $cols = array(), $where_cols = array(), $limit = 25 return null; } + // Get all columns, if specified. + if ( '*' === $cols ) { + $cols = $this->get_column_names(); + } + // Fetch all the columns for the table being queried. $column_names = $this->get_column_names(); From cf2d53b4632abc9ddce077ceab72e7160daf5ac6 Mon Sep 17 00:00:00 2001 From: Alex Standiford Date: Tue, 15 Oct 2019 08:09:59 -0400 Subject: [PATCH 2/3] Updates generated columns listing to use get_column_name keys, instead of the full array. #10 --- query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query.php b/query.php index 15529fd..36e7f0b 100644 --- a/query.php +++ b/query.php @@ -2793,7 +2793,7 @@ public function get_results( $cols = array(), $where_cols = array(), $limit = 25 // Get all columns, if specified. if ( '*' === $cols ) { - $cols = $this->get_column_names(); + $cols = array_keys( $this->get_column_names() ); } // Fetch all the columns for the table being queried. From 474cd0b846713f91ca9ce0bf1025ab126a51fc32 Mon Sep 17 00:00:00 2001 From: Alex Standiford Date: Tue, 15 Oct 2019 09:18:37 -0400 Subject: [PATCH 3/3] Revert "Updates generated columns listing to use get_column_name keys, instead of the full array. #10" This reverts commit cf2d53b4632abc9ddce077ceab72e7160daf5ac6. --- query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query.php b/query.php index 36e7f0b..15529fd 100644 --- a/query.php +++ b/query.php @@ -2793,7 +2793,7 @@ public function get_results( $cols = array(), $where_cols = array(), $limit = 25 // Get all columns, if specified. if ( '*' === $cols ) { - $cols = array_keys( $this->get_column_names() ); + $cols = $this->get_column_names(); } // Fetch all the columns for the table being queried.