// Connect to database $conn = mysqli_connect('localhost', 'username', 'password', 'database'); // Query the database $result = mysqli_query($conn, 'SELECT * FROM users'); // Close the database connection mysqli_close($conn);In this example, we connect to the database using the mysqli_connect() function, then execute a query using mysqli_query(). Finally, we close the connection with the mysqli_close() function. Package library: mysqli Overall, the mysqli extension provides object-oriented and procedural interfaces to connect to and interact with MySQL databases. The extension provides a low-level interface with the MySQL server for PHP applications.