php - Why SUM(`column`) returns a string instead of an integer? -


i'm using laravel , have query selects using db::raw() sum() of column:

db::raw("sum(points) game_points")

i have installed mysqldn , afaik laravel uses pdo.

but game_points string, no matter type of column is. (it's integer column)

also if do:

db::raw("count(id) foo_bar")

foo_bar returned integer.

it's neither laravel or pdo issue.

according manual, sum() returns decimal value exact-value arguments (integer or decimal). , way represent decimal type in php string.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -