Welcome Guest, Not a member yet? Register   Sign In
DB values returning as wrong types
#3

[eluser]Phil Sturgeon[/eluser]
Just any normal Active Record return using get(), do a var_dump on the results and you will see any number from the database returns as a string. I think the database library just assumes everything is a string, and doesn't treat integers, floats, decimals, etc any differently.

I know PHP is not a type-based language, and for most actions this doesn't make any different. But if you are making models that do get_type on the params, and try to act differently according to the type, you will get bumped as any number passed as an argument from the database will show as a string.


Messages In This Thread
DB values returning as wrong types - by El Forum - 12-15-2008, 09:46 AM
DB values returning as wrong types - by El Forum - 12-16-2008, 05:15 PM
DB values returning as wrong types - by El Forum - 12-17-2008, 07:24 AM
DB values returning as wrong types - by El Forum - 12-17-2008, 11:58 AM
DB values returning as wrong types - by El Forum - 12-18-2008, 07:11 AM
DB values returning as wrong types - by El Forum - 12-18-2008, 08:01 AM
DB values returning as wrong types - by El Forum - 12-18-2008, 08:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB