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