-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to a member function getResult() on boolean #409
Comments
Hm. Not able to replicate this. Using the latest version of develop, I used the following code in a controller:
This is using the database setup from the test data, but all three vars ($results, $developer, and $politician) bring back the correct data successfully. This is using MySQL. Can you confirm that your database is setup and you can access it through the build directly or with a raw query? Also, what database are you using, Postgre? I'm a little surprised you're running into this, honestly, since the live database tests on Travis are all coming back successfull. Once we figure out what this is, sounds like we need a better error report of what's actually happening here. |
yes, my db is setup and it works as should with ci3, my db is mysql, when i use query builder: $db = \Config\Database::connect();
$builder = $db->table('table');
$query = $builder->get(); ...everything works perfectly, but when i try to using anything from this guide but... i have tried your code example and again got that error on the $politician, the first and second bring back the correct data successfully |
Sorry, I completely dropped the ball on this one. Did you ever figure out what was going on? If not, can you:
|
I had got this issue, fixed now. I had altered table scheme, so column mentioned in select query was not present. My model code:
|
any find* method of model class throws this error:
i "played" a little in BASEPATH/Model.php file, and found that dumping
$builder->where($this->primaryKey, $id)->get()
(for example) works fine,var_dump
dumps it as it should, the line$builder->where($this->primaryKey, $id)->get()
is assigned to$row
variable, butvard_dump($row)
dumpsfalse
, so the next line$row = $row->getFirstRow($this->tempReturnType)
throws an error "Call to a member function getResult() on boolean"The text was updated successfully, but these errors were encountered: