看板 PHP 關於我們 聯絡資訊
麻煩看的懂的人 解釋一下 我看不懂 謝謝 <?php class db { private $host = 'localhost'; private $user = 'username'; private $pass = 'password'; private $type = 'mysqli'; public $lid = 0; // Connection function function connect() { $connect = $this->type.'_connect'; if (!$this->lid = $connect($this->host, $this->user, $this->pass)) { die('Unable to connect.'); } } } $db = new db; $db->connect(); ?> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.171.150.27
suckerlove:就是連結資料庫的class呀 12/02 23:01
Hsu0301:我看懂了Variable functions...謝謝 12/02 23:04