Welcome Guest, Not a member yet? Register   Sign In
MySQL int fields -> php strings
#1

[eluser]michaelUFL[/eluser]
SUMMARY

int fields fetched from MySQL get returned to php as string values

CONFIG

php 5.3.2
MySQL 5.1.49
CI_VERSION 1.7.2

DETAIL


I have searched through FAQ + SQL FAQ + forums and did not see any references to the problem I am having.

* I am fetching records from a MySQL database.

* some fields of the records are of type int and smallint

* the fields are showing up in php as string fields

* this is a problem for me because I am using json_encode to transfer to JavaScript and the problem gets replicated/transferred

I googled and found a reference to someone else having the same problem a few years ago:

http://www.webmasterworld.com/php/3618311.htm


I would rather find a general solution to this problem rather than hack it on a case-by-case basis.

It seems to me that this is a database connector issue ...

Q: What/who manages the database connector for CI & MySQL?

Q: Any other advice for me?


Thanks,
Michael


Messages In This Thread
MySQL int fields -> php strings - by El Forum - 09-16-2010, 11:01 AM
MySQL int fields -> php strings - by El Forum - 09-16-2010, 11:53 AM
MySQL int fields -> php strings - by El Forum - 09-16-2010, 12:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB