This is my db connect class which is working with php5.3 but it not working after i updated the php5.4 and show error that it's expired.
class DB {
function DB() {
$this->host = "localhost";
$this->db = "dbtest";
$this->user = "root" ;
$this->pass = "password";
$this->link = mysql_connect($this->host, $this->user, $this->pass) or die("<br>Could not connect 1: " . mysql_error());
mysql_select_db($this->db);
}
function query($query) {
$result = mysql_query($query, $this->link) or die ("<br>Could not execute command 1: ".mysql_error());
return $result;
}
function thislink() {
return $this->link;
}
function close() {
mysql_close($this->link);
}
}
How to change it into PDO or mysqli so the wamp could use it