我知道這很簡單,但我沒有完成它。如何在codeigniter中使用order-by?
$query = $this->db->get_where('prepared_forms', array('topic' => $this->input- >post('prepared_topics')));
$new_form = $query->row_array();
如何通過主題名稱(ASC)訂購預製表格?
我知道這很簡單,但我沒有完成它。如何在codeigniter中使用order-by?
$query = $this->db->get_where('prepared_forms', array('topic' => $this->input- >post('prepared_topics')));
$new_form = $query->row_array();
如何通過主題名稱(ASC)訂購預製表格?
$this->db->select("*")
->from('prepared_forms')
->where('topic', $this->input->post('prepared_topics'))
->order_by('topic', 'asc')
->get()
->result_array();
$this->db->order_by("topic", "asc");
$query = $this->db->get_where('prepared_forms', array('topic' => $this->input->post('prepared_topics')));
$new_form = $query->row_array();
試試這個:
$query = $this->db->order_by('topic', 'asc')->get_where('prepared_forms', array('topic' => $this->input->post('prepared_topics')));
$new_form = $query->row_array();