Answered
Help with the error Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
How do I change this code to the extension msqli or pdo so that the error goes away?
How do I change this code to the extension msqli or pdo so that the error goes away?
Ebay is correct.
The following would work:
try {
$dbd = new PDO($db, $user, $pw, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
$dbd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
}
catch (PDOException $e) {
die('Connection failed: ');
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.