How can you establish a connection between PHP and MySQL?

2025

How can you establish a connection between PHP and MySQL?

  1. A.

    Using the "connect()" function in PHP

  2. B.

    By including a PHP library

  3. C.

    By embedding MySQL queries directly in PHP code

  4. 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.

Explore the full course: Rssb Basic Computer Instructor