错误号码:1054
未知列'数组'在' where子句'
SELECT `cat_name` FROM (`cat_manager`) WHERE `parent_id` = Array
答案 0 :(得分:0)
如果您使用的是codeigniter,那么为什么不使用codiegniter活动记录库来使SQL查询将它们编写为纯SQL。
$select = $this->db->select('cat_name')
->from('cat_manager')
->where_in('parent_id', $yourArray);
$result = $this->db->get()->result_array();
答案 1 :(得分:0)
public function function_name()
{
$data = $_POST['input field name'];//align variable to data
$query = $this->db->query("SELECT cat_name FROM cat_manager WHERE parent_id='$data'");//retrieve single item which is equal to $data
$result = $query->result_array();//asign it has objective array
return $result;//return array
}