PHP/Class/ set — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 10:00, 26 мая 2010
__set( ) method is called whenever an undefined property is set in your scripts
<source lang="html4strict">
<?
class MyTable { public $Name; public function _ _construct($Name) { $this->Name = $Name; } public function _ _set($var, $val) { mysql_query("UPDATE {$this->Name} SET $var = "$val";"); } } $systemvars = new MyTable("systemvars"); $systemvars->AdminEmail = "t@s.net";
?>
</source>