CodeIgniter Forums
A PHP Error was encountered - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: A PHP Error was encountered (/showthread.php?tid=70773)



A PHP Error was encountered - Pankaj Kumar - 05-29-2018

Hello Friends,

Please Help me to solve the errors.

Thank You.
Pankaj Kumar.

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: property
Filename: admin/edit_property.php
Line Number: 24
Backtrace:
File: C:\wamp64\www\ci-project\application\views\admin\edit_property.php
Line: 24
Function: _error_handler

File: C:\wamp64\www\ci-project\application\controllers\admin.php
Line: 69
Function: view

File: C:\wamp64\www\ci-project\index.php
Line: 315
Function: require_once



RE: A PHP Error was encountered - enlivenapp - 05-29-2018

it can't find $property->pname in edit_property.php


$property was passed to the view, so you'll need to access it as $pname


If you want it to be $property->pname you need to do this in your controller:

PHP Code:
$data['property'] = $this->property->find_property($properties_id);
   
$this->load->view('admin/edit_property',$data); 


see the docs: https://codeigniter.com/user_guide/general/views.html#adding-dynamic-data-to-the-view


RE: A PHP Error was encountered - Pankaj Kumar - 05-31-2018

A PHP Error was encountered
Severity: Notice

Message: Undefined variable: property

Filename: admin/edit_property.php

Line Number: 4

Backtrace:

File: C:\wamp64\www\ci-project\application\views\admin\edit_property.php
Line: 4
Function: _error_handler

File: C:\wamp64\www\ci-project\application\controllers\admin.php
Line: 67
Function: view

File: C:\wamp64\www\ci-project\index.php
Line: 315
Function: require_once

A PHP Error was encountered
Severity: Notice

Message: Trying to get property of non-object

Filename: admin/edit_property.php

Line Number: 4

Backtrace:

File: C:\wamp64\www\ci-project\application\views\admin\edit_property.php
Line: 4
Function: _error_handler

File: C:\wamp64\www\ci-project\application\controllers\admin.php
Line: 67
Function: view

File: C:\wamp64\www\ci-project\index.php
Line: 315
Function: require_once


Dear Friends Please help me to solve the error I am beginner


RE: A PHP Error was encountered - Pankaj Kumar - 06-06-2018

Dear Friends please guide me to solve this error I am beginner and I try to solve it but I can't so please help me.

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: property
Filename: admin/edit_property.php
Line Number: 5
Backtrace:
File: C:\wamp64\www\ci-project\application\views\admin\edit_property.php
Line: 5
Function: _error_handler

File: C:\wamp64\www\ci-project\application\controllers\admin.php
Line: 67
Function: view

File: C:\wamp64\www\ci-project\index.php
Line: 315
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: admin/edit_property.php
Line Number: 5
Backtrace:
File: C:\wamp64\www\ci-project\application\views\admin\edit_property.php
Line: 5
Function: _error_handler

File: C:\wamp64\www\ci-project\application\controllers\admin.php
Line: 67
Function: view

File: C:\wamp64\www\ci-project\index.php
Line: 315
Function: require_once