Welcome Guest, Not a member yet? Register   Sign In
Undefined valuable
#1

Hello guys,
I've two models mark_m and setting_m and am try to get some data from setting table and display it in mark view
but when i try i get this kind of error


Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: schoolTitle
Filename: mark/view.php
Line Number: 23


A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: mark/view.php
Line Number: 23

Below is my code;
setting_m.php -- model

PHP Code:
public function get_school() {
 
  $query $this->db->query("SELECT sname FROM setting");
 
  return $query->result();


mark.php -- controller
PHP Code:
function __construct() {
        
parent::__construct();
        
$this->load->model("student_m");
        
$this->load->model("mark_m");
 
               $this->load->model('setting_m');
        
$language $this->session->userdata('lang');
        
$this->lang->load('mark'$language);
    }

public function 
sch_title(){
 
       $this->data["schoolTitle"]     = $this->setting_m->get_school();
 
       $this->data["subview"] = "error";
 
       $this->load->view('_layout_main'$this->data);
 
   

view.php -- views
Code:
<section class="panel"><?=$schoolTitle->sname?></h1>
           <div class="profile-view-head">
               <a href="#"><h1>
                   <?=img(base_url('uploads/images/'.$student->photo))?>
               </a>

               <h1><?=$student->name?></h1>
               <p><?=$this->lang->line("mark_classes")." ".$classes->classes?></p>

           </div></section>

where am i going wrong please help me

Attached Files
.php   exam.php (Size: 5.39 KB / Downloads: 104)
.php   view.php (Size: 23.62 KB / Downloads: 127)
.php   setting_m.php (Size: 2.16 KB / Downloads: 85)
Reply


Messages In This Thread
Undefined valuable - by kayinja.denis - 05-09-2017, 12:54 AM
RE: Undefined valuable - by neuron - 05-09-2017, 01:07 AM
RE: Undefined valuable - by kayinja.denis - 05-11-2017, 06:29 AM
RE: Undefined valuable - by php_rocs - 05-09-2017, 08:13 AM
RE: Undefined valuable - by neuron - 05-10-2017, 02:41 AM
RE: Undefined valuable - by kayinja.denis - 05-10-2017, 03:30 AM
RE: Undefined valuable - by neuron - 05-11-2017, 06:48 AM
RE: Undefined valuable - by InsiteFX - 05-10-2017, 03:48 AM
RE: Undefined valuable - by kayinja.denis - 05-10-2017, 04:17 AM
RE: Undefined valuable - by mirivlad - 05-10-2017, 08:08 AM
RE: Undefined valuable - by InsiteFX - 05-10-2017, 12:06 PM
RE: Undefined valuable - by kayinja.denis - 05-11-2017, 04:28 AM
RE: Undefined valuable - by InsiteFX - 05-11-2017, 09:14 AM
RE: Undefined valuable - by xenomorph1030 - 05-11-2017, 08:17 AM
RE: Undefined valuable - by kayinja.denis - 05-11-2017, 10:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB