/ Published in: PHP
A class for simply connect and do a query on a database
Expand |
Embed | Plain Text
/* * A class for simply connect and do a query on a database * */ Class MySQL { public function __construct($config, $database) { if ($this->haveconnected == True) { self::close(); } } $this->config = $config; $this->database = $database; $this->havequeryed = False; $this->haveconnected = True; } public function query($query) { if ($this->havequeryed == True) { self::__construct($this->config, $this->database); } $this->havequeryed = True; } { $output = $list; { endwhile; } return $output; } function __destruct() { } } public function close() { self::__destruct(); } }
You need to login to post a comment.
