What are the potential risks and benefits of using mysql_pconnect() in a PHP application with multiple frames?

When using mysql_pconnect() in a PHP application with multiple frames, the potential risk is that persistent connections can lead to resource exhaustion and database server overload. However, the benefit is that it can improve performance by reusing existing connections. To mitigate the risks, it's important to properly manage and limit the number of persistent connections being used.

// Establish a new MySQL connection without using persistent connections
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}