Good day!
I work with CI. I fulfill the request:
function edit_template($data = array()) { if ($data) { $sql = " UPDATE {$this->_db} SET title = " . $this->db->escape($data['title']) . ", check = " . $this->db->escape($data['check']) . ", message = " . $this->db->escape($data['message']) . " WHERE id = " . $this->db->escape($data['id']) . " "; $this->db->query($sql); if ($this->db->affected_rows()) { return TRUE; } } return FALSE; } I get the error:
Error Number: 1064
You have an error in your SQL syntax; If you’re on the line, you’ll have to check it.
UPDATE sms_template SET title = 'Deposit account', check = '1', message = '23', WHERE id = '1'
What am I doing wrong? Without the check = " . $this->db->escape($data['check']) . ", everything works without errors.
Grateful for any help!
checkwhat type in the table has in your php? - br3t