1<?php 2 3include_once __DIR__ . '/../include.php'; 4 5$config = include_once __DIR__ . '/00_config_connect.php'; 6 7 8$db = new ClickHouseDB\Client($config); 9 10//$db->verbose(); 11$db->settings()->readonly(false); 12 13 14$result = $db->select( 15 'SELECT 12 as {key} WHERE {key} = :value', 16 ['key' => 'ping', 'value' => 12] 17); 18 19if ($result->fetchOne('ping') != 12) { 20 echo "Error : ? \n"; 21} 22 23print_r($result->fetchOne()); 24 25 26 27echo 'elapsed :'.$result->statistics('elapsed')."\n"; 28echo 'rows_read :'.$result->statistics('rows_read')."\n"; 29echo 'bytes_read:'.$result->statistics('bytes_read')."\n"; 30 31// 32$result = $db->select("SELECT 12 as ping"); 33 34print_r($result->statistics()); 35/* 36 "statistics": 37 { 38 "elapsed": 0.000029702, 39 "rows_read": 1, 40 "bytes_read": 1 41 } 42 43 */ 44