I'm having problem while fetching data from database and converting into json using codeigniter. I've following database
create table todolist(
todo_id int,
todo_content text
)
with these example entity in database
1 assignment
2 lab report
3 notes making
4 preparing meal
5 cleaning room
6 feeding pet
I have written following function in Todo_Controller
public function json(){
$content = $this->db->get('todolist'); //todolist table name
echo json_encode($content);
}
I'm getting following output
{"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}
your help will be highly appreciated.