• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
T_OBJECT_OPERATOR error with active record result (PHP 4.4.8)

#1
[eluser]Rubiz'[/eluser]
Hello all!

Well, I'm getting an error:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /nfs/c01/h04/mnt/45239/domains/webresolv.com.br/html/trendpro/system/application/models/trendpro_model.php on line 13

But in this line I have only:
return $this->db->get( $table )->result();

where $table value is the name of some table in database.

My host is MediaTemple, and PHP version is 4.4.8

Some idea about the solution?

#2
[eluser]wiredesignz[/eluser]
When using PHP4 you will not be able to use method chaining.
Try breaking the chained statements into workable parts.
Code:
//return $this->db->get( $table )->result();

$query = $this->db->get( $table );
return $query->result();

#3
[eluser]Unknown[/eluser]
hello all,

I am a new here, I want to ask,
My design uses CI with PHP5 when I uploaded it to my existing hosting server error constraints:

Parse error: syntax error, Unexpected T_OBJECT_OPERATOR in / home / bitsolus / public_html / bitsolusi / application / controllers / home.php on line 43

whether this is caused by differences in the php version of it ?
or there is a solution to solve this case ?

please i need your solution ...!

home.php on line 43

function profile_list() {
//Cek role dari user
if($this->is_admin()) {
$this->load->library('pagination');
$config['base_url']=base_url().'index.php/home/profile_list/';
$this->db->where('nama_menu','profile');
$config['total_rows']=$this->db->get('menu')->num_rows(); //-----> line 43
$config['per_page']=2;
$config['num_links']=10;
$this->pagination->initialize($config);

$this->load->model('Profile_model');
$data['profiles']=$this->Profile_model->getAll($config);
$this->load->view('menu/profile_list',$data );
}else {
$this->restrict();
}
}

#4
[eluser]WanWizard[/eluser]
See the reply from @wiredesignz in the previous post.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.