|
今天做删除,为啥返回真,数据还存在呢?
删除标签这么写的:<a target="main" href="<?php echo site_url('article/delete');?>/<?=$row['id']?>">删除</a>
删除方法这么写的:
function delete()
{
$segs = $this->uri->segment_array();
$this->load->model('article_model');
$this->model_article->id = $segs[3];
if($this->article_model->delete())
{
echo "删除文章成功";
}else
{
echo "删除文章失败";
}
}
model方法这么写的:
function delete()
{
$query = $this->db->delete('article',array('id'=>'$this->id'));
var_dump($query);
if($query)
{
return 1;
}else
{
return 0;
}
}
返回真,不知道为啥数据未删除,求解!哪里配置的有问题吗?
|
|