dqluw20882 2016-10-16 12:46
浏览 33

只应通过引用传递变量database / DB_active_rec.php

I am new to codeigniter, I just want to ask how to get rid with this thing

     A PHP Error was encountered

     Severity: Notice
     Message: Only variables should be passed by reference
     Filename: database/DB_active_rec.php
     Line Number: 225

I dont know why, this suddenly comes out, but my page is doing fine, but this is at the top of my page, how to get rid of this thing, this is what i have:

Pages_Controller:
public function clients_ordered_products($id){
    if(isset($_SESSION["id"])){
        if($_SESSION["Usertype"]==1){
            $this->load->view('admin/header');
            $this->load->view('title/title_admin');
            $this->load->view('admin/navigation');
            $this->data["posts"] = $this->Generate_Model->getProductsClientsOrdered($id);
            $this->load->view('admin/clients_ordered_products',$this->data);
            $this->load->view('admin/footer');
        }
        else if($_SESSION["Usertype"]==0){
            redirect('Pages_Controller/Ooops_Client');
        }
    } 
    else{
        redirect($url);
    }           
}

and

Generate_Model:
public function getProductsClientsOrdered($id){
    $this->db->select('*');
    $this->db->select_sum('tbl_product_selected.Quantity');
    $this->db->from('tbl_product_selected');
    $this->db->join('tbl_product','tbl_product.Product_ID = tbl_product_selected.Product_ID');
    $this->db->where('Account_ID',$id);
    $this->db->where('Purchase_time',NULL);
    $this->db->where('Active',1);
    $this->db->group_by('tbl_product_selected.Product_ID');
    $query = $this->db->get();
    return $query->result();
}

and

  <div id="page-wrapper">
  <div class="cart">
  <div class="container">
         <div class="col-md-9 cart-items">
                    <!-- /.panel-heading -->
                    <div class="panel-body">
<table id="cart" class="table table-hover table-responsive">
    <thead>
        <tr>
            <th>Product Name</th>
            <th>Price</th>
            <th>Quantity</th>
            <th class="text-center">Subtotal</th>
            <th>Action</th>
        </tr>
    </thead>
    <?php $total = 0; ?>
    <?php foreach($posts as $post){ ?>
            <form action="<?php echo base_url(); ?>index.php/Transaction_Controller/removeItem/<?php echo $post->Product_selected_id; ?>" method="post">
                <tbody>
                    <tr>
                       <td data-th="Product">
                            <div class="row">
                                <div class="col-sm-2 hidden-xs"> <img style="height:100px;"src="<?php echo $post->Directory?>"></div>
                                <div class="col-sm-10">
                                    <h4 class="nomargin"></h4>
                                </div>
                            </div>
                        </td>
                        <td data-th="Price"><?php echo $post->Price;?></td>
                        <td data-th="Price" style="text-align:left"><input type="number" value="<?php echo $post->Quantity; ?>" class="form-control" style="width:60px"/></td>
                        <td data-th="Price" style="text-align:center"><?php echo $subtotal = $post->Price * $post->Quantity; ?></td>    
                        <td class="actions" data-th="">
                            <a href="#" class="btn btn-primary btn-sm">UPDATE</a> 
                            <button class="btn btn-danger btn-sm">DELETE<i class="fa fa-trash-o"></i></button>                               
                            </td>
                    </tr>
                    <?php $total += $subtotal; ?>
                </tbody>
                <tfoot>
                    <tr class="visible-xs">
                        <td class="text-center"><strong>


                        </strong></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td colspan="2" class="hidden-xs"></td>
                        <td></td>
                        <td></td>
                    </tr>
                </tfoot>
            </form>
                <?php } ?>
            </table>
               <center><form action="<?php echo base_url(); ?>index.php/Transaction_Controller/Products_Ordered/" method="post">
                    <input type="hidden" value="<?=$total?>" name="total"/>
                    <input type="hidden" value="<?php echo $post->Account_ID; ?>" name="id"/>
                    <button type="submit" class="btn btn-success btn-block">PAY NOW! <i class="fa fa-angle-right"></i></button>
                </form><br/><br/>
     </div>
     </div>
     </div>
     </div>

why is this happening?

  • 写回答

2条回答 默认 最新

  • dsq30861 2016-10-16 17:01
    关注

    This notice is triggered by E_STRICT error reporting, because of this code in CodeIgniter 2:

    // DB_active_rec.php line 225
    
    end(explode('.', $item));
    


    CodeIgniter 2 is not developed anymore and you should update to CodeIgniter 3.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题