auth icon indicating copy to clipboard operation
auth copied to clipboard

#change current() to next() in simpleauth to get the first result

Open hrz11 opened this issue 7 years ago • 5 comments

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.*

hrz11 avatar Aug 05 '18 17:08 hrz11

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.

WanWizard avatar Aug 05 '18 22:08 WanWizard

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.

hrz11 avatar Aug 07 '18 02:08 hrz11

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.)?

WanWizard avatar Aug 09 '18 12:08 WanWizard

  1. DB driver: mysql, enable_cache: false -> returns null
  2. DB driver: mysql, enable_cache: true -> works properly
  3. DB driver: mysqli, enable_cache: false -> returns null
  4. DB driver: mysqli, enable_cache: true -> works properly The first set of settings is my original. Would like to keep it that way.

hrz11 avatar Aug 10 '18 02:08 hrz11

Thanks, I'll have a look.

WanWizard avatar Aug 14 '18 20:08 WanWizard

Was an issue in the database result class, and has been fixed there.

WanWizard avatar Jun 07 '25 13:06 WanWizard