致命错误:在第44行的public_html / opunletter / application / controllers / Welcome.php中调用未定义的方法select :: form()

时间:2015-05-28 03:04:19

标签: php codeigniter

我收到错误:

  

致命错误:在第44行的public_html / opunletter / application / controllers / Welcome.php中调用未定义的方法select :: form()。

当我跑这个。可能是什么原因。

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


class Welcome extends CI_Controller {


    public function index()  
      {  
         //load the database  
         $this->load->database();  
         //load the model  
         $this->load->model('select');  
         //load the method of model  
         $data['h']=$this->select->select();  

         $data['a']=$this->select->archieve(); 
          $data['n']=$this->select->latest(); 
          $id=$this->input->get("id");
            $data['f']=$this->select->load($id); 

         //return the data in view  
         $this->load->view('welcome_message', $data);  
      }  
      public function login()
      {

      $this->load->view('userlogin');  
      }  
         public function submit()
      {

          $data = array(
          'from' => $this->input->post('from'),
          'to' => $this->input->post('to'),
          'title' => $this->input->post('title'),
          'openletter' => $this->input->post('openletter')

           );

           $this->load->model('select');  

            //Transfering data to Model
           $this->select->form($data);

         } 


      } ?>

我的模特

<?php  
   class Select extends CI_Model  
   {  
      function __construct()  
      {  
         // Call the Model constructor  
         parent::__construct();  
      }  
      //we will use the select function  
      public function Select()  
      {  
         //data is retrive from this query  
         $query = $this->db->get('country');  
         return $query;  
      }  
         public function archieve()  
      {  
         //data is retrive from this query  
         $query = $this->db->query("SELECT * FROM country WHERE archieve=1;");  
         return $query;  
      }  
           public function latest()  
      {  
         //data is retrive from this query  
         $query = $this->db->query("SELECT * FROM country WHERE latest=1;");  
         return $query;  
      }  
           public function load($id)  
      {  
         //data is retrive from this query  
$query = $this->db->select('*')
        ->from('country')
        ->where('open_id', $id)
        ->get();
        return $query;
      } 
    public function form($data){
// Inserting in Table(students) of Database(college)
$query = $this->db->insert('user_openletter', $data);
return $query;
}

   }  
?>   

0 个答案:

没有答案