DB类host=$host; $this->user=$user; $this->pass=$pass; $this->data=$data; $this->conn=$conn; $this->code=$code; $this->connect(); } public function __get($name){return $this->$name;} public function __set($name,$value){$this->$
MySQL数据库可以通过触发器,使之无法修改某些字段的数据,同时又不会影响修改其他字段。
DROP TRIGGER IF EXISTS `members`;
SET OLD_SQL_MODE=SQL_MODE, SQL_MODE='';
DELIMITER //
CREATE TRIGGER `members` BEFORE UPDATE ON `members` FOR EACH ROW BEGIN
set new.name = old.name;
set new.cellphone