I have a db table:
ConfigID | Type | Key | Value
--------------------------------------------------------------
0 | "API" | "ClientID" | "iofoewi"
1 | "API" | "ClientSecret" | "eijfoiewjfioejfoiewjfoie"
Take the following code:
$data = array(
array(
'Key' => "ClientID",
'Value' => $testAPICredential->ClientID
),
array(
'Key' => "ClientSecret",
'Value' => $testAPICredential->ClientSecret
)
);
try
{
$this->context->db->trans_start();
$this->context->db->update_batch( $this->tableName, $data, "Key" );
$this->context->db->trans_complete();
return ($this->context->db->trans_status() === FALSE)? FALSE:TRUE;
}
catch( Exception $e )
{
return FALSE;
}
It outputs this SQL when I use the profiler:
UPDATE `config` SET `Value` = CASE
WHEN `Key` = 'ClientID' THEN 'iofoewi2'
WHEN `Key` = 'ClientSecret' THEN 'eijfoiewjfioejfoiewjfoie2'
ELSE `Value` END WHERE `Key` IN ('ClientID','ClientSecret')
And yet the database table is un=touched?
Any ideas?