用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2096|回复: 1
收起左侧

[已解决] 数据库操作问题

[复制链接]
发表于 2011-4-13 16:46:44 | 显示全部楼层 |阅读模式
if(is_numeric($condition))
        {
            $where['id']=$condition;
        }
        $where=$condition;
        $this->db->where($where);
        return  $this->db->delete($table);


为什么执行的sql语句是


Error Number: 1054
Unknown column '3' in 'where clause'
DELETE FROM `message_admin` WHERE `3` IS NULL
Filename: D:\wamp\www\CodeIgniter_2.0.1\CodeIgniter_2.0.1\system\database\DB_driver.php
Line Number: 330

求解
发表于 2011-4-13 16:54:11 | 显示全部楼层
删除方法一行代码
$this->db->delete($table,array('id'=>$id));

本版积分规则