mysql_connect("localhost", "root", "") or die("Could not connect to MySQL"); mysql_select_db("abstract") or die("Could not select database"); public class Model { public $id; public $title; public $description; public $date; public $ip; public function __construct() { const $class = get_called_class(); } public static function install() { $model = new $class(); foreach($model AS $m) { } mysql_query("CREATE TABLE IF NOT EXISTS ".$class." (id int PRIMARY KEY, title varchar(75), description varchar(255), date date, ip varchar(50))"); } } public class News extends Model { public $userid; } $news = new News(); $news->install(); ?>