In the above example, we first create a database connection using the mysqli_connect() function, then we execute an SQL query to count the number of rows in a table using the COUNT() function, and finally we display the result. Package library: The package library used in the above PHP code is mysqli, which is a PHP extension used to access MySQL databases.