hi guys...
ive been working with codeigniter for over a year now, but ive been taking scripts apart and fixing errors/adding new functions, ....now im coding something from scratch and its proving to be quite annoying as the new version has a lot of stuff changed, so im pretty much goin crazy.

basically what im doing is trying to create a script that will display messages based on the user id!
but....im having issues grabbing data from the database, instead of my code pulling seperate messages, its only getting the first one it comes to...ive tried many many things and im goin crazy...heres my code....

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Wall extends CI_Controller {
  public $outputData;	
	function __construct(){
		parent::__construct();
	 //   $this->config->db_config_fetch();	
		
		    $this->load->model('User_model');
		    $this->load->helper('url');  

	}
	
	function userWall(){
	$this->load->helper('url');  
		
		    if($this->uri->segment(3))
		    	
     {
      //Get Project Id

      $user_id   = $this->uri->segment(3,'0');
      $conditions = array('status.to' => $user_id); 
      $status   =  $this->User_model->getStatus($conditions);
      $show_status = $status;
      			}

			if($user_id == 2) {
	
		foreach($status->row() as $row){
		//	echo $row->from;
		//	echo $row->message;
		echo $row;

			}
		}	else 	{
		echo 'no user';
	$this->load->view('test'); 
	

	

			}
	}


}

if i uncomment the echo $row->message i get an error "Message: Trying to get property of non-object" ..and the "row" code is only displaying the first message it comes to!!

any help is very much appreciated, this should be simple but working with the new ci is just makin me cry :P

Recommended Answers

All 6 Replies

I looked up codeigniter and it claims to be a "Web Application Framework that helps you write PHP programs". But from your query, it seems it's not helping you at all, since what you want to do can be done in php without any difficulty.

My advice is to use php, and forget about this hindrance-disguised-as-an-aide

to be honest im starting to think the same!! i decided to write my new site in codeigniter because im familiar with it...(an earlier 2009 version)

but the changes made in how the code is writtin is just making me angry, simple things are not working...i had to create a url helper page with about 200 lines of script just to link a css stylesheet to my pages! ...its a lot of unnecessary work!

Just try checking out the documentation. It helps most of the time.

lol, s'why i always prefer to get down n dirty with the code

Just try checking out the documentation. It helps most of the time.

it certainly DOESNT!!!

Member Avatar for diafol

Frameworks always sap the energy out of me. Codeigniter was no different. If you like them, knock yourself out. If not, they're not essential, unless your workplace is using one!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.