<?php header('Content-type:text/html;charset=gbk;'); date_default_timezone_set('PRC'); class db{ private $conn=null; public function __construct($dsn,$user,$password){ try{ $this->conn = new PDO($dsn, $user, $password); }catch(PDOException $e){ echo…