error_reporting(0);
header('Content-Type:application/json; charset=utf-8');
//程序运行时间
$starttime = explode(' ',microtime());
$dbh = new PDO('mysql:host=localhost;dbname=test', 'xhcm_admin', 'xhcm@2010@admin');
$login = 'admin';
$sql = "SELECT * FROM `user` WHERE `id` = 1";
$stmt = $dbh->prepare($sql);
$stmt->execute();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
print_r($row);
}
//程序运行时间
$endtime = explode(' ',microtime());
$thistime = $endtime[0]+$endtime[1]-($starttime[0]+$starttime[1]);
$thistime = round($thistime,3);
$time_mes="耗时:".$thistime." 秒。".time();
echo $time_mes;
未标题-2.jpg
( 143.06 KB 下载:7 次 )
最佳答案