0

如何解决此错误?

SELECT user_id, CONCAT(firstname, ' ', lastname) AS fullname FROM user AND status = '1' in .../database/mysql.php on line 49

这是实际的代码:

$query = $this->db->query("SELECT user_id, CONCAT(firstname, ' ', lastname) AS fullname FROM " . DB_PREFIX . "user " . $except . " AND status = '1'");

我检查了这些字段,我的所有用户的个人资料中都有名字/姓氏。

4

2 回答 2

0

你需要一个 where 子句——不仅仅是从 AND 开始

$query = $this->db->query("SELECT user_id
, CONCAT(firstname, ' ', lastname) AS fullname 
FROM " . DB_PREFIX . "user " . $except . " 
WHERE status = '1'");
于 2012-06-06T14:35:53.687 回答
0

尝试用 WHERE 替换AND -认为这会做你想要的

于 2012-06-06T14:36:37.773 回答