CodeIgniter Forums
how to filter query result to json - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: how to filter query result to json (/showthread.php?tid=63010)



how to filter query result to json - mojidabckuu - 09-15-2015

Using codeigniter I faced with some problem.
This lib gives us possibility directly transfer model to response and convert to json, but what if I need to filter my json before sending it back, what should I do?
Example:
I performed SELECT * FROM users and perform if statements on some properties then I want to send back only first_name and last_name not all columns...