错误号:1292 在我的 SQL 错误中截断了不正确的 DOUBLE 值 [英] Error Number: 1292 Truncated incorrect DOUBLE value in my SQL error
问题描述
我有这样的显示错误 1292 截断不正确的 DOUBLE 值这是我在代码点火器模型中的删除操作功能代码
i have display error like this 1292 Truncated incorrect DOUBLE value this is my delete operation function code in code igniter model
public function delete_marks($s_id){
$this->db->where_not_in('student_id', $s_id);
return $this->db->delete('student_marks');
}
及其显示错误
错误编号:1292
截断了不正确的 DOUBLE 值:'305,304'
DELETE FROM student_marks WHERE student_id NOT IN ('305,304')
Error Number: 1292
Truncated incorrect DOUBLE value: '305,304'
DELETE FROM student_marks WHERE student_id NOT IN ('305,304')
因为在这部分 '305,304'
单配额 ' '
自动添加所以它的显示 1292 错误我该如何解决?
because of in this portion '305,304'
single quota ' '
auto added
so its display 1292 error
how to i fix it?
推荐答案
看起来你的 $s_id
是字符串.在 CI 中,where_not_in
或 where_in
必须传递数组.
It looks like your $s_id
is string. In CI, where_not_in
or where_in
you have to pass array.
public function delete_marks($s_id){
$s_id = explode(",", $s_id);
$this->db->where_not_in('student_id', $s_id);
return $this->db->delete('student_marks');
}
这篇关于错误号:1292 在我的 SQL 错误中截断了不正确的 DOUBLE 值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!