[英]Data truncated for column 'diameter' at row 1 on Mysql
Getting an error while trying to insert data into Mysql Table using datamapper ( Codeigniter )尝试使用 datamapper ( Codeigniter ) 将数据插入 Mysql 表时出错
Data truncated for column 'diameter' at row 1
INSERT INTO `purchases` (`bills_id`, `products_id`, `quantity`, `diameter`, `lena`, `lenb`, `lenr`, `thicka`, `thickb`, `widtha`, `widthb`, `boxes`, `resulta`, `resultb`) VALUES (1, 28, '2', '', '', '', '', '', '', '', '', '1', '', 2)
Here is the screenshot of the table这是表格的截图
You're trying to insert an empty string ''
into double
.您正在尝试将空字符串
''
插入double
。 You cannot store string
in a double
column.您不能将
string
存储在double
列中。 Make sure the date type is double
or compatible ( int
, float
)确保日期类型为
double
或兼容( int
, float
)
Either insert a 0
要么插入
0
INSERT INTO `purchases` (`bills_id`, `products_id`, `quantity`, `diameter`, `lena`, `lenb`, `lenr`, `thicka`, `thickb`, `widtha`, `widthb`, `boxes`, `resulta`, `resultb`) VALUES (1, 28, '2', 0, '', '', '', '', '', '', '', '1', '', 2)
or或
If there is no value, simply skip it in the query如果没有值,只需在查询中跳过它
INSERT INTO `purchases` (`bills_id`, `products_id`, `quantity`, `lena`, `lenb`, `lenr`, `thicka`, `thickb`, `widtha`, `widthb`, `boxes`, `resulta`, `resultb`) VALUES (1, 28, '2', '', '', '', '', '', '', '', '1', '', 2)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.