ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

there is a reference to a non-existent variable

February 17, 2013 10:24pm

Subscribe [1]
  • #1 / Feb 17, 2013 10:24pm

    mjoymeca

    1 posts

    hello, I am just new here in codeigniter. I couldn’t understand how to solve the error. Can you please help me? I’m having a difficulty finding a solution to this error.

    I got error:

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined variable: data
    Filename: admission/profile_inq.php
    Line Number: 22

    A PHP Error was encountered
    Severity: Warning
    Message: Invalid argument supplied for foreach()
    Filename: admission/profile_inq.php
    Line Number: 22

    View:

    <table id="grid" width="100%" border="0">
    <tr>
                <td width="20%" align="center" colspan="10" class="student_list"  arial';" >Student Inquirers</td>
            </tr>
                </table>
        <div class="content_main" id="content_main">
    <a href="http://$view_link%22name=%22inquirers_list%22&gt" class="header">$view_icon</a>";
                        echo "<td >".$view."</td>";
                        echo "</tr>";
            }
            ?>
    
        </table>
    </a>
        </div>


    model:

    function student_inq(){
            $select = array("`a`.`client_id`",
                            "`a`.`fname`",
                            "`a`.`lname`",
                            "`a`.`gender`",
                            "`a`.`dob`",
                            "`a`.`contact1`",
                            "`a`.`contact2`",
                            "`a`.`AO_incharge`",
                            "`b`.`reg_date`");
            $this->db->select($select);
            $this->db->from("`cl_client` `a`, `cl_bank` `b`");
            $this->db->where("`b`.`bank_id` = `a`.`bank_id` AND (`a`.`client_id`) NOT IN (SELECT `cl_admission`.`client_id` FROM `cl_admission`)");
            $res = $this->db->get();
    
            $data['result'] = $res->result();
            return $data['result'];
        }


    controller:

    function inquirers ($start=0)
       {
           try{
                $this->load->model('admission/admission_model','obj',TRUE);
                $limit = 20;
                $cur_url = base_url().index_page()."/admission/student_inq/";
                $data['paging'] = $this->_pagination($cur_url, $limit,'', $start);
                $target_view = 'admission/profile_inq.php';
                $data['result'] = $this->obj->student_inq();
                $this->_base_construct($this->nav_index, $target_view,$data);
            }
            catch(Exception $e){
    
            }
        }
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases