fuel / auth

Fuel PHP Framework - Fuel v1.x Authentication package
http://fuelphp.com/docs/packages/auth/intro.html
76 stars 57 forks source link

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

Open hrz11 opened 6 years ago

hrz11 commented 6 years ago

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

WanWizard commented 6 years ago

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.

hrz11 commented 6 years ago

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.

WanWizard commented 6 years ago

To be able to debug this:

hrz11 commented 6 years ago

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.

WanWizard commented 6 years ago

Thanks, I'll have a look.