i am using zend paginator in my app.pagination works well but i get this error Trying to get property of non-object in
$user = new Zend_Session_Namespace('user');
$user_id =$user->user_id;
$DB = Zend_Db_Table_Abstract::getDefaultAdapter();
$select = $DB->select()
->from(array('p' => 'phone_service'))
->join(array('u' => 'user_preferences'), 'u.phone_service_id = p.phone_service_id')
->where('u.user_preferences_name = ?', 'is_user_package_active')
->where('p.user_id = ?', $user_id);
$adapter = new Zend_Paginator_Adapter_DbSelect($select);
$paginator = new Zend_Paginator($adapter);
$this->view->paginator=$paginator;
in my view i am doing so
foreach($this->paginator as $record){
<td><?php echo $record->phone_service_name;?></td>
<td><?php echo $record->phone_service_type;?></td>
<td ><?php echo $record->phone_service_Duration;?></td>}
which is giving following error
Notice: Trying to get property of non-object
when i do so in my view
var_dump($this->paginator);
[_tableCols:protected] => Array
(
)
there are no data of columns
Any Hint PLZ ???
make it sure column names in DB and in your code are same.mean spelling are same
or $record['phone_service_name']
once i got this error and the problem was i miss spell column name hope it helps