What potential issues can arise from not properly closing SQL connections in PHP?

Not properly closing SQL connections in PHP can lead to resource leaks, which can cause performance issues and potentially exhaust the available connections to the database server. To solve this issue, it's important to always close the SQL connection after using it to free up resources and prevent any potential problems.

// Establish a connection to the database
$connection = new mysqli($servername, $username, $password, $dbname);

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

// Perform SQL queries

// Close the connection after using it
$connection->close();