I'm getting the following error in codeigniter once I deploy it in server. I do not get this error in localhost. I'm not sure where I'm going wrong. Any suggestions. I'm using Google Apps Engine.
Fatal error: Call to a member function result_array() on a non-object
in /base/data/home/apps/s~some-app/1.401263586523638658/application/models/Some_model.php on line 199
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /base/data/home/apps/s~some-app/1.401263586523638658/application/models/Some_model.php:199)
Filename: core/Common.php
Line Number: 569
Backtrace:
A PHP Error was encountered
Severity: Error
Message: Call to a member function result_array() on a non-object
Filename: models/Some_model.php
Line Number: 199
Backtrace:
I checked the controller and models for any white space and I do not have any such. This particular function is also not used by any cron job as mentioned in another post.
Edited to add code:
$query = "select u.id, u.queue_name, u.queue_email, u.tickets_for_all
from agent_queue_mapping_table as m, queue_table as u
where u.id=m.queue_id
and u.company_id = ".$this->session->userdata('user_comp_id')."
and m.user_id = ".$this->session->userdata('user_id');
$queue_details = $this->db->query($query);
return $queue_details->result_array();
1.Check the PHP version of your server.
2.Get your SQL query by using $this->db->last_query() and run the query on MySQL console and check if there any errors.
3.Check the result_array() array function usage in your controller. send us your screenshot of the code here to check on that section
I got this error, because I had not updated a table that I had to alter. Once I did that, this issue got resolved.
Related
I thought I had resolved this error when I added the if block below, but I'm still erroring out. This line of code is causing the following errror:
Fatal PHP error on line 95 of /XXXXX/GetContactValuesOsVc.php:
Trying to get property of non-object
Line 95 is the if condition here:
if($contact->CustomFields->c->ask_again->LookupName){
$Contactname=$contact->CustomFields->c->ask_again->LookupName;
}
Anyone know why merely checking for existence (what that line should be doing I think) would be causing the error im getting?
I want to use different databases for different language files. I can get language code with this;
$this->lang->lang()
I have to define it as pre_controller hook, so system will select right database at the beginning. But when I try to use the code above, I'm getting a fatal error.
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Hooks::$lang
Filename: config/hooks.php
Line Number: 13
Fatal error: Call to a member function lang() on a non-object in...
This is my code;
$hook['pre_controller'] = define('LANG', isset($_SESSION['lang']) ? $_SESSION['lang'] : $this->lang->lang());
Thanks in advance.
I'm using PHP class from https://github.com/constantcontact/Constant-Contact-PHP-Sample-Contact-Forms to add new contacts to Constant Contact list, but recently I have got PHP error messages:
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 1
Filename: cc_class.php
Line Number: 248
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 1
Filename: cc_class.php
Line Number: 252
where those lines look like:
(248)
$xml = simplexml_load_string($return);
(252)
}
and full related function to those two lines:
public function subscriberExists($email = '') {
$call = $this->apiPath.'/contacts?email='.$email;
$return = $this->doServerCall($call);
$xml = simplexml_load_string($return);
$id = $xml->entry->id;
if($id){ return $id; }
else { return false; }
}
but it passes data to Constan Contact anyway.
Any clue what is going on there with those error messages?
Thanks
From the class GitHub
This is just a PHP notice, not a failure, when trying to access an
index of an array that hasn't been defined yet. The codebase in this
app is fairly old, and hasn't been brought up to date as PHP is
upgraded.
We would recommend instead of using this repo, utilizing the newer PHP
SDK which is object-oriented, available via composer, and kept up to
date. You can definitely mute these notifications in your environment,
but this repo is deprecated, so this issue won't be addressed in the
project.
Since a couple of days I can't load a model in a codeigniter system anymore.
It gives the following error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Clients::$mdl_clients
Filename: controllers/clients.php
Line Number: 48
Controller code:
private function GetAllClients()
{
$this->load->model('clients_model', 'mdl_clients');
$clients = $this->mdl_clients->getClients()->result_array();
return $clients;
}
I read the codeigniter documentation again, and I'am not doing anything wrong that I'am aware of..
Can you guys help me out?
Change the model name by 'clients_model.php' if you dont have, and your class most name 'Clients_model'
It was a weird issue with my server. I uploaded everything to another, and it worked again
I got the following error in my nusoap file,
Notice: Undefined property: nusoapclient::$operation in /PATH/nusoap.php on line 6837
Any one got this error and have solution?
I got this error when I was using the "send" method instead of call. It looks like operation gets set when "call" is called, but is not set when send is called by itself.
did this:
$client = new nusoap_client($url);
$client->operation = "SomeOperation";
$client->send($data,$url."/SomeOperation");
At last, I got the correct solution after upgrade the soap version. now the problem is sort over and working well. I did't get the problem again.