php - Laravel / MySQL / Javascript stack: integer is returned as string on production, but not locally, why? -
i'm building cms uses laravel restful api , react (+ redux) frontend. (i've isolated problem separate frontend)
the cms handles multiple sites multiple pages. when user adds new page, sends new site data: page title, , id of parent site. (i.e. 'new-page
', '15
')
after api saves data, returns new instance fresh database - page title, parent site id, , new page id (primary key) has has been assigned database.
but, reason cannot figure out, on production server, site_id
being returned string, , not integer. (this caused headache can solve parseint()
, i'd know what's up).
the code running on each identical. i've confirmed on both site_id
column in database set int(10) unsigned
. call api returns site , of associated pages gives me these results (note site_id
property on each):
slight differences between 2 environments:
php
php --version (development) php 5.6.24 (production) php 5.6.21
and
mysql
select version() (development) 5.7.13 (production) 5.6.25-73.1
both using laravel 5.2.39.
why value defined in database int returned string across these 2 environments?
update:
mysqlnd
installed on both local , production environment.
Comments
Post a Comment