这是我的代码
$this->db->select('*, CONCAT(left(card_id, 1 ), right(card_id, 6 )) AS character_id', FALSE);
错误:遇到错误
Unknown column '1' in 'field list'
请在这件事上给予我帮助!!!
这是我的代码
$this->db->select('*, CONCAT(left(card_id, 1 ), right(card_id, 6 )) AS character_id', FALSE);
错误:遇到错误
Unknown column '1' in 'field list'
请在这件事上给予我帮助!!!
您似乎忘记指定您的表名。
请将 [tablename] 替换为您的表名:
$this->db->query('SELECT *, CONCAT(left(card_id, 1 ), right(card_id, 6 )) AS character_id FROM [tablename]');
或者:
$this->db->select("*, CONCAT(left(card_id, 1 ), right(card_id, 6 )) AS character_id");
$this->db->from("[tablename]");
$res = $this->db->get();
试试这个方法
$this->db->select("*, CONCAT(left(card_id, 1 ), right(card_id, 6 )) AS character_id",FALSE);
$this->db->from("table");
$query = $this->db->get();
return $query;