forked from oshanrube/dbcompair
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbcompare.php
More file actions
executable file
·32 lines (28 loc) · 870 Bytes
/
dbcompare.php
File metadata and controls
executable file
·32 lines (28 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
class dbcompare{
private $host = "";
private $user = "";
private $pass = "";
private $dbname = array();
protected $dbconnection = array();
public function __construct(){
$this->host = "localhost";
$this->user = "joomlaen";
$this->pass = "joomlaen";
$this->dbname[1] = "joomlaen";
$this->dbname[2] = "joomlaes";
}
protected function connect(){
$this->dbconnection[1] = new mysqli($this->host, $this->user, $this->pass, $this->dbname[1]);
$this->dbconnection[2] = new mysqli($this->host, $this->user, $this->pass, $this->dbname[2]);
/* check connection */
if ($this->dbconnection[1]->connect_errno) {
printf("Connect failed: %s\n", $this->dbconnection[1]->connect_error);
exit();
}
if ($this->dbconnection[2]->connect_errno) {
printf("Connect failed: %s\n", $this->dbconnection[2]->connect_error);
exit();
}
}
}