错误号:1292 在我的 SQL 错误中截断了不正确的 DOUBLE 值 [英] Error Number: 1292 Truncated incorrect DOUBLE value in my SQL error

查看:46
本文介绍了错误号:1292 在我的 SQL 错误中截断了不正确的 DOUBLE 值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的显示错误 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_inwhere_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆