admin_updater_model.php 928 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. class admin_updater_model extends Model {
  3. public function update_field($table,$field,$value,$id,$key) {
  4. $table = $this->escapeString($table);
  5. $field = $this->escapeString($field);
  6. $value = $this->escapeString($value);
  7. $id = $this->escapeString($id);
  8. $key = $this->escapeString($key);
  9. $this->execute("UPDATE ".$table." SET ".$field."='".$value."' WHERE ".$key."='".$id."';");
  10. return true;
  11. }
  12. public function update_multiple_field($table,$field,$value,$id,$key) {
  13. $table = $this->escapeString($table);
  14. $field = $this->escapeString($field);
  15. $value = $this->escapeString($value);
  16. $id = $this->escapeString($id);
  17. $key = $this->escapeString($key);
  18. $this->execute("UPDATE ".$table." SET ".$field."='".$value."' WHERE ".$key."=".$id.";");
  19. return true;
  20. }
  21. }