File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
lib/Skeleton/Database/Driver Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,12 @@ public function get_column($query, $params = []) {
418
418
$ statement ->execute ();
419
419
$ result = $ statement ->fetch_assoc ();
420
420
421
+ if (count ($ result ) == 0 ) {
422
+ return [];
423
+ } elseif (count ($ result [0 ]) != 1 ) {
424
+ throw new \Exception ('Resultset has more than 1 column ' );
425
+ }
426
+
421
427
$ col = [];
422
428
foreach ($ result as $ row ) {
423
429
$ col [] = array_shift ($ row );
Original file line number Diff line number Diff line change @@ -502,6 +502,12 @@ public function get_column($query, $params = []) {
502
502
$ statement ->execute ();
503
503
$ result = $ statement ->fetch_assoc ();
504
504
505
+ if (count ($ result ) == 0 ) {
506
+ return [];
507
+ } elseif (count ($ result [0 ]) != 1 ) {
508
+ throw new \Exception ('Resultset has more than 1 column ' );
509
+ }
510
+
505
511
$ col = [];
506
512
foreach ($ result as $ row ) {
507
513
$ col [] = array_shift ($ row );
You can’t perform that action at this time.
0 commit comments