0

i have problem with CI when insert data is integer into database. My field is oauth_uid[varchar(250)], when i use active record insert value is 10205796940433933 into that field, it's become 1.0205796940434E+16

how to fix it!

sorry, my english is not good

Code Metal
  • 602
  • 2
  • 8
  • 19
  • Check [this](http://stackoverflow.com/questions/3135804/types-in-mysql-bigint20-vs-int20) question/answer. Also check column [type](http://dev.mysql.com/doc/refman/5.7/en/integer-types.html) in db table. – Tpojka Apr 22 '16 at 20:40

2 Answers2

0

This is from php, if you have a int value and you wold like to convert to make a cast to string you only need to make is

$new_v  = (string) $int_value;

$data_to_insert = array(
                         //other values
                         'oauth_uid'   =>  $new_v
                       );
elddenmedio
  • 1,030
  • 1
  • 8
  • 15
0

I also happened to the same thing and the problem was that I sent GET the form and received it in Controller as POST

Dharman
  • 30,962
  • 25
  • 85
  • 135
CarlosPinedaT
  • 3,741
  • 1
  • 12
  • 4