Skip to content

Instantly share code, notes, and snippets.

@markkimsal
Created September 14, 2017 22:35
Show Gist options
  • Save markkimsal/49935cc36ede1f56de3ca35f3e85f7e5 to your computer and use it in GitHub Desktop.
Save markkimsal/49935cc36ede1f56de3ca35f3e85f7e5 to your computer and use it in GitHub Desktop.
PDO doesn't close the connection
<?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