Created
September 14, 2017 22:35
-
-
Save markkimsal/49935cc36ede1f56de3ca35f3e85f7e5 to your computer and use it in GitHub Desktop.
PDO doesn't close the connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user = 'docker'; | |
$pass = 'mysql'; | |
$dsn = "mysql:host=mariadb;dbname=mysql"; | |
$select = 'SELECT * from time_zone'; | |
$conn=new PDO($dsn,$user,$pass); | |
$data = $conn->query($select); | |
foreach($data as $row) { | |
print_r($row); | |
} | |
$conn=null; | |
gc_collect_cycles(); | |
sleep(100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment