“字段列表”中的未知列“数据库字段”

时间:2017-01-23 08:21:48

标签: php mysql codeigniter

这是我的Model函数及其在localhost中的完美工作:

这个函数自己加入一个表:

public function GetWikiPostArticle()
{

    $this->db->select('article.*,A.id as Aid,A.title as Atitle,A.shorttext as Ashorttext,A.full_text as Afull_text,A.picture as Apicture,A.auther as Aauther,A.date as Adate,A.view as Aview,A.liked as Aliked,A.level as Alevel,A.parent_article as Aparent_article,A.random as Arandom');
    $this->db->from('article as A');
    $this->db->join('article', 'A.id = article.parent_article');

    $query = $this->db->get();

    return $query;
}

但是当它上传到主机时我有这个错误:

Error Number: 1054

Unknown column 'A.level' in 'field list'

SELECT `article`.*, `A`.`id` as `Aid`, `A`.`title` as `Atitle`, `A`.`shorttext` as `Ashorttext`, `A`.`full_text` as `Afull_text`, `A`.`picture` as `Apicture`, `A`.`auther` as `Aauther`, `A`.`date` as `Adate`, `A`.`view` as `Aview`, `A`.`liked` as `Aliked`, `A`.`level` as `Alevel`, `A`.`parent_article` as `Aparent_article`, `A`.`random` as `Arandom` FROM `article` as `A` JOIN `article` ON `A`.`id` = `article`.`parent_article`

Filename: models/M_cleint.php

Line Number: 38

0 个答案:

没有答案