Welcome Guest, Not a member yet? Register   Sign In
Update database
#6

[eluser]anyamanggar[/eluser]
[quote author="nagata" date="1339744877"]
Code:
function update($id) {
        $data = array(
          ' title' => $this->input->post('title'),
            'slug' => $this->input->post('slug'),
            'intro' => $this->input->post('intro'),
            'text' => $this->input->post('text'),
        );
        $this->db->where('id', $id);
        $this->db->update('news', $data);
}
bases on some of the code i had for my application, this should work for you
[/quote]

erorr like this, after i used your code

Code:
Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'slug` = 'uuuuu', `intro` = 'uuuuu', `text` = '

\r\n uuuuu
\r\n' WHERE `id` ' at line 1

UPDATE `news` SET ` title = 'uuuuuhhh', `slug` = 'uuuuu', `intro` = 'uuuuu', `text` = '

\r\n uuuuu
\r\n' WHERE `id` = '28'

Filename: C:\AppServ\www\mitra\system\database\DB_driver.php

Line Number: 330


Messages In This Thread
Update database - by El Forum - 06-14-2012, 11:33 PM
Update database - by El Forum - 06-14-2012, 11:41 PM
Update database - by El Forum - 06-14-2012, 11:49 PM
Update database - by El Forum - 06-15-2012, 12:21 AM
Update database - by El Forum - 06-15-2012, 12:34 AM
Update database - by El Forum - 06-15-2012, 12:44 AM
Update database - by El Forum - 06-16-2012, 05:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB