public static function delete($name, $array) { $sql = "delete FROM " . $name; if ($array) { $first = true; $sql .= " where "; foreach ($array as $key => $value) { if (!$first) { $sql = " and "; } else { $first = false; } $sql .= $key . "='" . $value . "' "; } } LOG::trace("sql:{$sql}"); $ds = new DataSource(); $result = $ds->query($sql); if (!is_numeric($result)) { if ($ds->error()) { throw new Exception($ds->error()); } } return $result; }
static function ass($val) { LOG::trace("value:" . print_r($val, true)); }