Reputation: 27
I know this is simple but i didn't complete it.
$query = $this->db->get_where('prepared_forms', array('topic' => $this->input- >post('prepared_topics')));
$new_form = $query->row_array();
How can order prepared forms order by topic name (ASC)?
Upvotes: 2
Views: 19160
Reputation: 41
Try this:
$query = $this->db->order_by('topic', 'asc')->get_where('prepared_forms', array('topic' => $this->input->post('prepared_topics')));
$new_form = $query->row_array();
Upvotes: 4
Reputation: 3246
$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();
Upvotes: 2
Reputation: 42380
$this->db->select("*")
->from('prepared_forms')
->where('topic', $this->input->post('prepared_topics'))
->order_by('topic', 'asc')
->get()
->result_array();
Upvotes: 4