#change current() to next() in simpleauth to get the first result
DB::select_array->execute()->current() is always null even though there are results in the array. Using next() will get the first one.
There may be a better way to resolve it but that worked for me
I was upgrading my fuelphp 1.0 -> 1.9, php 5.3 -> 7.*
You might not be up to date with the latest updates. This was a bug in the database result class, that has been fixed in 1.9/develop and should also be fixed in the latest 1.8.1 hotfix.
Just in case tested it again with 1.8.1 and also with 1.9/develop that I am currently using. Result is the same - the database result class returns null. Simpleauth is the only place I could find current() used with DB::select_array...maybe that is the right place to dig.
To be able to debug this:
- What DB driver are you using?
- what is the config value of "enable_cache"?
- what happens if you change the cache (true -> false or v.v.)?
- DB driver: mysql, enable_cache: false -> returns null
- DB driver: mysql, enable_cache: true -> works properly
- DB driver: mysqli, enable_cache: false -> returns null
- DB driver: mysqli, enable_cache: true -> works properly The first set of settings is my original. Would like to keep it that way.
Thanks, I'll have a look.
Was an issue in the database result class, and has been fixed there.