Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DB_CONNECT {
- public $con = null;
- function __construct($host) {
- $this->connect($host);
- }
- function __destruct() {
- $this->close();
- }
- function connect($host) {
- $this->con = mysqli_connect($host, DB_USER, DB_PASSWORD, DB_DATABASE);
- $this->con->set_charset("utf8");
- }
- function close() {
- if($this->con)
- mysqli_close($this->con);
- }
- }
- $db = new DB_CONNECT('database-server-001');
- $db->close();
- $db = new DB_CONNECT("database-server-002");
- $query = "SELECT * from his_track_recods";
- $getHistResult = mysqli_query($db->con, $query);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement