【发布时间】:2011-08-11 20:05:21
【问题描述】:
您好,我正在尝试使用 codeigniter 中的 ckeip jquery 插件更新数据库中的现有数据。我能够更新数据库中的数据。但是当我刷新页面时,数据库字段再次显示零值。我不知道这是发生了什么。
你能解释一下吗.. 如果我有另一个 div 要使用 ckeip 更新,而不是我应该如何使用 tel php 脚本只更新这个特定的脚本
谢谢
=================这里是我的模型代码==================
function get(){
$query = $this->db->select('content')->from('about')->where('id', 1)->get();
return $query->result();
}
function update_abx(){
$up_data = array('content' => $this->input->post('content'));
$this->db->where('id', 1);
$this->db->update('about', $up_data);
}
==================这里是我的控制器代码===============
function index(){
$data['paste'] = $this->test->get();
$this->load->view('index_view', $data);
}
function abc(){
$query = $this->test->update_abx();
$this->load->view('index_view');
}
==================这是我的查看文件代码================
<div id="editable" name="sample">
<?php
foreach($paste as $row){
echo $row->content;
}
?>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#editable').ckeip({
e_url: 'site/abc',
});
});// enf of the document ready function
【问题讨论】:
标签: php jquery mysql codeigniter