get('user_profile',$con-6ren">
gpt4 book ai didi

codeigniter - 不等于 Codeigniter 事件记录中的比较

转载 作者:行者123 更新时间:2023-12-02 08:42:15 25 4
gpt4 key购买 nike

我对这个代码收到的错误感到很困惑

$this->db->order_by('uid','DESC')->where('type!=',"Admin")->get('user_profile',$config['per_page'], $this->uri->segment(3));

这是我得到的错误

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Admin' ORDER BY `uid` DESC LIMIT 10' at line 3

SELECT * FROM (`user_profile`) WHERE `type!=` 'Admin' ORDER BY `uid` DESC LIMIT 10

Filename: C:\wamp\www\proposal\system\database\DB_driver.php

Line Number: 330

最佳答案

像这样尝试你的查询。 Admin 使用单逗号而不是双逗号。和 <> 而不是 !=

$this->db
->where('type <>','Admin')
->order_by('uid','DESC')
->get('user_profile',$config['per_page'], $this->uri->segment(3));

关于codeigniter - 不等于 Codeigniter 事件记录中的比较,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15473965/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com