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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -