I am using get() method in data mapper to select columns from database. I am passing this object to json_encode(); When I do this, I get this error
json_encode() type is unsupported, encoded as null
Update three
["{\"id\":1,\"name\":\"JOHN\",\"city\":\"null\"}"
,"{\"id\":2,\"name\":\"MICHEAL\,\"city\":\"null\"}"]
This is my response, I do not select city but still city appears. How to get json in correct format
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data
[Break On This Error]
var jsonData = JSON.parse(data);