Answers
class C {
private $_table;
public static function t($table)
{
$c = new C();
$c->_table = $table;
return $c;
}
public function delete($id)
{
$sql = "delete from `" . $this->_table ."` where `id`='" . $id . "'";
//执行sql语句
}
}
C::t('table')->delete($id);
其他朋友说了很多,我就闲得蛋疼给你贴一段代码吧,没有测试,大概是这个意思。
emilpro
answered 9 years, 5 months ago