dongse5408
2013-01-16 14:52
浏览 63
已采纳

遇到PHP错误严重性:通知消息:未定义的变量:querry_array

I tried solving the title but I really wanted to know the solution , oh well the code with the error goes here:

<?php
class Schedules extends CI_Controller {


function display($query_id = 0, $sort_by = 'event_name', $sort_order = 'asc', $offset = 0) {

    $limit = 20;
    $data['fields'] = array(
        'event_id' => 'ID',
        'event_name' => 'Title',
        'schedule' => 'Schedule',
        'date_expired' => 'Expired',
        'clientname' => 'Clientname',
        'cost' => 'Cost'
    );
    $this->input->load_query($query_id);

    $query_array = array(
        'event_name' => $this->input->get('event_name'),
        'date_expired' => $this->input->get('date_expired'),
        'length_comparison' => $this->input->get('length_comparison'),
        'date_expired' => $this->input->get('date_expired'),
    );
    $data['query_id'] = $query_id;

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

    $results = $this->Schedule_model->search($querry_array, $limit, $offset,     $sort_by, $sort_order); // this is line number 27 which displays  error

    $data['schedules'] = $results['rows'];
    $data['num_results'] = $results['num_rows'];
> Call to undefined function form_open() in C:\xampp\htdocs\ci\application\views\schedules.php on line 34//Also this error display too, code here:

<?php echo form_open('schedules/search'); ?>//this line is number 34 that display an error
    <div>
        <?php echo form_label('Event Name:', 'event_name'); ?>
        <?php echo form_input('event_name', set_value('event_name'), 'id="event_name"'); ?>
    </div>

    <div>
        <?php echo form_label('Schedule:', 'schedule'); ?>
        <?php echo form_dropdown('schedule', $category_options, 
            set_value('schedule'), 'id="schedule"'); ?>
    </div>

    <div>
        <?php echo form_label('Date Expiree:', 'date_expired'); ?>
        <?php echo form_dropdown('length_comparison', 
            array('gt' => '>', 'gte' => '>=', 'eq' => '=', 'lte' => '<=', 'lt' => '<') , 
            set_value('length_comparison'), 'id="length_comparison"'); ?>
        <?php echo form_input('date_expired', set_value('date_expired'), 'id="date_expired"'); ?>
    </div>

    <div>
        <?php echo form_submit('action', 'Search'); ?>
    </div>

<?php echo form_close(); ?>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongsaohu6429 2013-01-16 14:53
    已采纳

    Typo:

    $results = $this->Schedule_model->search($querry_array, etc...
                                                 ^-- extra R
    

    Since you've defined it as:

    $query_array = array(
        ...snip...
    

    earlier, with ONE r.

    点赞 评论

相关推荐 更多相似问题