[eluser]Brad K Morse[/eluser]
I enabled the output profiler and it displays the following query:
Code:
UPDATE abs_subprojects SET account_id = '105' WHERE abs_subproject_number = '3CH00002'
but when I view the table in my GUI (sequel pro), it does not reflect the changes that update query should of made.
I did some debug logging and it returns what I expect.
Code:
$sql = 'UPDATE abs_subprojects SET account_id = ? WHERE abs_subproject_number = ?';
$update = $CI->db->query($sql, array($account_id, $row->abs_subproject_number));
if ($CI->db->affected_rows() === 1)
{
log_message('debug', 'abs_subproject_number_condition: ' . $condition);
log_message('debug', 'abs_subproject_number_update: ' . $update);
log_message('debug', 'abs_subproject_number: ' . $row->abs_subproject_number);
return new self($row->abs_subproject_number);
}
Here is the create table query for the table it is trying to save to:
Code:
CREATE TABLE `abs_subprojects` (
`abs_subproject_number` varchar(8) NOT NULL,
`account_id` int(10) unsigned DEFAULT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`abs_subproject_number`),
UNIQUE KEY `account_id_UNIQUE` (`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
I have tried this multiple times and nothing seems to work. It writes to other tables in the database with no problem and does not return any errors when it displays the query in the output profiler.
I made sure the db username has every privilege for that table too.