Kod
public function update()
{
$postId = $this->input->post('postId');
$this->db->select('answers');
$this->db->from('posts');
$this->db->where('id', $postId);
$q = $this->db->get()->result();
echo (json_encode($q));
}
{
$postId = $this->input->post('postId');
$this->db->select('answers');
$this->db->from('posts');
$this->db->where('id', $postId);
$q = $this->db->get()->result();
echo (json_encode($q));
}
Oto co zwraca "echo"
Kod
0: {,…}
answers: "[{"text":"bbb","votes":0,"id":0},{"text":"cccc","votes":0,"id":1},{"text":"aaaa","votes":0,"id":2}]"
answers: "[{"text":"bbb","votes":0,"id":0},{"text":"cccc","votes":0,"id":1},{"text":"aaaa","votes":0,"id":2}]"
Prosze o pomoc
