[eluser]talwinder[/eluser]
Hi, I am trying to update my database content using CKEIP. this is a jquery plugin which uses the ckeditor to allow edit a div when it is double clicked.
I am unable to update my table. please help.
==============here is my model code=========
Code:
class Test extends CI_Model{
// to get record from db
function get(){
$query = 'SELECT * FROM about WHERE id = 1';
$q = $this->db->query($query);
foreach($q->result() as $row){
$data[] = $row;
}
return $data;
}
function update_data(){
$p_data = array(
'content' => $this->input->post('content')
);
$this->db->where('id', 2);
$this->db->update('about', $p_data);
}
}
=================== here is controller code============
Code:
class Index extends CI_Controller{
function __construct(){
parent:: __construct();
}
function index(){
$data['monty_b'] = $this->test->get();
$data['testy'] = $this->test->update_record();
$this->load->view('index_view', $data);
}
}
====== here is view code=====================
Code:
<div id="tal">
<?php
foreach($monty_b as $p){
echo $p->content . '<br/>';
}
?>
</div>
[removed]
$('#tal').ckeip({
e_url: '<?php echo $testy; ?>', // this is the file url which perform the the update task
data:{
content:'here will be content i want to update in the database'
}
});
[removed]