converting database data into json in codeigniter
<p>I'm having problem while fetching  data from database and converting into json using codeigniter. 
I've following database </p>

<pre><code>create table todolist(
todo_id int,
todo_content text
)
</code></pre>

<p>with these example entity in database </p>

<pre><code>1        assignment
2        lab report
3        notes making
4        preparing meal
5        cleaning room
6        feeding pet
</code></pre>

<p>I have written following function in Todo_Controller</p>

<pre><code>public function json(){
$content = $this-&gt;db-&gt;get('todolist'); //todolist table name
echo  json_encode($content);
}
</code></pre>

<p>I'm getting following output</p>

<pre><code>{"conn_id":{"affected_rows":null,"client_info":null,"client_version":null,"connect_errno":null,"connect_error":null,"errno":null,"error":null,"field_count":null,"host_info":null,"info":null,"insert_id":null,"server_info":null,"server_version":null,"sqlstate":null,"protocol_version":null,"thread_id":null,"warning_count":null},"result_id":{"current_field":null,"field_count":null,"lengths":null,"num_rows":null,"type":null},"result_array":[],"result_object":[],"custom_result_object":[],"current_row":0,"num_rows":null,"row_data":null}
</code></pre>

<p>your help will be highly appreciated.</p>