Q. Which of the following is a correct way to connect to MySQL using PDO?
β
Correct Answer: (A)
new PDO('mysql:host=localhost;dbname=test', 'root', '');
Explanation: The correct way is to create a PDO instance with DSN, username, and password.