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

遇到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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器