I am currently printing data from an SQL query using print json_encode($query->result());
Which is giving a result of all the fields in the database. It currently prints :
[{"id":"3812","assigned_to":"1","opportunity_id":null,"lead_stage":"1","first_name":"Jamie","last_name":"Warren","company_name":"","phone_number":"+1","email_address":"[email protected]"},
However I need it to print in the following format :
items": [
{ "id":"3812"
How can i add the items part?