Here is how my website connected to mysql database untill php was upgraded to version 5.4
public function core() {
if (!@$this->dbCon = mysql_connect($this->host, $this->user,$this->password)) {
exit('Error: Could not make a database connection using ' .
$this->user . '@' . $this->host);
}
But now, I get Error: Could not make a database connectionz using user@host
.
How do I rewrite this code using PDO?
mysql functions are deprecated. Try to use mysqli_connect function.