![]() |
I have four tables that each have a virtually identical model. Three of them work perfectly, but one returns boolean instead of an array of results. I'm racking my brain trying to figure this out. I can replace the model calls in the controller line-by-line with the equivalent calls from any other model, and I get the expected array. I put the fourth one in and I get a boolean. The only difference I can see / find is that the table that is returning boolean only has a single line of data, where the others have multiple lines of data. What am I missing here?
TeamsModel.php: Code: <?php TestController.php: Code: <?php test.php (View) Code: <?= $this->extend('layouts/default') ?> Result: TEST 1: bool(true)
array_sort_by_multiple_keys() returns bool.
See https://codeigniter.com/user_guide/helpe...tiple_keys
Thanks a bunch for the solution. I'm a dummy - I just realized the difference between where I was getting the boolean was that I assigned it to a variable in this one, where I simply ran the function in the others.
Returned boolean: $var = array_sort_by_multiple_keys($teams, [ 'team_name' => SORT_ASC, ]); Returns sorted array: array_sort_by_multiple_keys($teams, [ 'team_name' => SORT_ASC, ]); Time to put down my mouse and pick up a whiskey. Thanks again. |
Welcome Guest, Not a member yet? Register Sign In |