#pdo #php Connection to Database in PHP Data Object (pdo) - Class 1

preview_player
Показать описание
PDO will work on 12 different database systems, whereas MySQLi will only work with MySQL databases.

Note: In the PDO example above we have also specified a database (myDB). PDO require a valid database to connect to. If no database is specified, an exception is thrown.

 A great benefit of PDO is that it has an exception class to handle any problems that may occur in our database queries. If an exception is thrown within the try{ } block, the script stops executing and flows directly to the first catch(){ } block.
Рекомендации по теме