php db new PDO mysql host 127 dbname ebemaspnet root test db- query SE

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<?php
$db = new PDO('mysql:host=127.0.0.1;dbname=ebemaspnet', 'root', '');
$test = $db->query('SELECT `key` FROM `test`')->fetchAll();
$array = [];
foreach($test as $key => $data){
$array[$key] = md5($data['key']);
}
echo count($array);
?>