0

Using codeignite framework, PHP and mysql when I do a query all data retreived are typed as String. Maybe muy tables have got strings, integers... Bit if I return a JSON of the query rows, al values are String. Well, I can cast any value that I considerate that is a int, boolean, ... but this is a boilerplate conde that I want forget.

Is there any way to query data and receive the real type¿

jlmg5564
  • 1,380
  • 13
  • 28
  • 3
    might be related http://stackoverflow.com/a/2317938/3859027 and this http://stackoverflow.com/a/2430657/3859027 – Kevin Feb 28 '15 at 16:39
  • No magic solution, it's a mysql limitation. [See this](http://stackoverflow.com/q/2430640/3778613) . Maybe `field_data()` will help you [link](http://www.codeigniter.com/user_guide/database/fields.html) – AdrienXL Feb 28 '15 at 16:41
  • I believe that the key is use PDO, no? – jlmg5564 Feb 28 '15 at 17:20

0 Answers0