2

このコードで受け取ったこのエラーにかなり混乱しています

$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
4

1 に答える 1

6

このようなクエリを試してください。2 つのコンマではなく、単一のコンマを管理者に使用します。<> != の代わりに

$this->db
    ->where('type <>','Admin')
    ->order_by('uid','DESC')
    ->get('user_profile',$config['per_page'], $this->uri->segment(3));
于 2013-03-18T10:01:32.630 に答える