How can you establish a connection between PHP and MySQL?
2025
How can you establish a connection between PHP and MySQL?
- A.
Using the "connect()" function in PHP
- B.
By including a PHP library
- C.
By embedding MySQL queries directly in PHP code
- D.
By using the "mysqli_connect()" function in PHP
Attempted by 60 students.
Show answer & explanation
Correct answer: D
In PHP, a MySQL connection can be established using mysqli_connect(), passing the server, username, password and database details as needed.