2016-04-22 41 views
0

當插入數據是整數到數據庫時,CI有問題。 我的領域是oauth_uid [varchar(250)],當我使用活動記錄插入值是10205796940433933進入該領域,它變成1.0205796940434E + 16Codeigniter:如何將int轉換爲字符串,然後插入到數據庫中

如何解決它!

對不起,我的英語不是很好

+0

檢查[這](HTTP://計算器。 com/questions/3135804/types-in-mysql-bigint20-vs-int20)question/answer。還要在db表中檢查column [type](http://dev.mysql.com/doc/refman/5.7/en/integer-types.html)。 – Tpojka

回答

0

這是PHP的,如果你有一個int值,你沃爾德想轉換爲使強制轉換爲字符串,你只需要提出的是

$new_v = (string) $int_value; 

$data_to_insert = array(
         //other values 
         'oauth_uid' => $new_v 
         ); 
0

---- -------西班牙語

阿彌tambien我sucedio羅MISMOŸEL problema radicaba連接闕enviaba GET EL formularioŸ滷味recibia連接Controlador科莫POST

---英語-------

我也發生了同樣的事情,問題是,我發送GET形式並獲得其在控制器POST

相關問題