function _db_update($tbl, $hash, $where, $cluster, $shard) { $bits = array(); foreach (array_keys($hash) as $k) { $bits[] = "`{$k}`='{$hash[$k]}'"; } return _db_write("UPDATE {$tbl} SET " . implode(', ', $bits) . " WHERE {$where}", $cluster, $shard); }
function _db_update($tbl, $hash, $where, $cluster, $shard=null){ $bits = array(); foreach(array_keys($hash) as $k){ $bits[] = "`$k`='$hash[$k]'"; } return _db_write("UPDATE $tbl SET ".implode(', ',$bits)." WHERE $where", $cluster, $shard); }