illustrate
1. It can support 12 different types of database drivers, so PDO has received more praise.
2. PDOs have other features that make them a better choice for most developers.
PDO connection
The first is to connect to the database. Since PDO is completely object-oriented, we will use the PDO class example.
All you need to do is define the host, database name, username, password and database character set.
$host = 'localhost'; $db = 'theitstuff'; $user = 'root'; $pass = 'root'; $charset = 'utf8mb4'; $dsn = "mysql:host=$host;dbname=$db;charset=$charset"; $conn = new PDO($dsn, $user, $pass);
The above is an introduction to the PDO library in php. I hope it will be helpful to everyone.