欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

codeigniter - php 新手 问题

程序员文章站 2022-05-25 15:27:43
...
model
    class Stock_model extends CI_Model{

        private $hsh;
        function __construct()
        {
            parent::__construct();
            $_ci = & get_instance();


            //$this->hsh = $_ci->load->database('hsh',TRUE);
            $hsh = $_ci->load->database('hsh',TRUE);
        }



        function  get_stock($goods_huo)
        {
            if(isset($goods_huo))
            {
                $hsh->where('item_huo',$goods_huo);
                $query =  $hsh->get('item_info');

                return $query->result_array();
                $query->free_result();

            }
        }
    }

报错

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: hsh

Filename: models/stock_model.php

Line Number: 22

相关标签: codeigniter php