-
- /// @todo store the cache data in the same way like the config data
- q(
- "REPLACE INTO `cache` (`k`,`v`,`expire_mode`,`updated`) VALUES ('%s','%s',%d,'%s')",
- dbesc($key),
- dbesc(serialize($value)),
- intval($duration),
- dbesc(datetime_convert())
- );
+ $fields = array('v' => serialize($value), 'expire_mode' => $duration, 'updated' => datetime_convert());
+ $condition = array('k' => $key);
+ dba::update('cache', $fields, $condition, true);