<?phpuseTDengine\Connection;useTDengine\Exception\TDengineException;try{// 实例化$host='localhost';$port=6030;$username='root';$password='taosdata';$dbname='power';$connection=newConnection($host,$port,$username,$password,$dbname);// 连接$connection->connect();$resource=$connection->query('SELECT ts, current FROM meters LIMIT 2');var_dump($resource->fetch());}catch(TDengineException$e){// 捕获异常throw$e;}