连接数据库
//连接数据库 $dsn = 'mysql:host=139.*.*;dbname=topv;charset=utf8'; $user = 'topv'; $pass = 'topv1234!'; $db = new PDO($dsn, $user, $pass);
获取分区名称及属性信息
//获取分区名称及属性信息; $sql = "SELECT partition_name part,partition_expression expr,partition_description descr,table_rows FROM INFORMATION_SCHEMA.partitions WHERE TABLE_SCHEMA = schema() AND TABLE_NAME = 'jk_data'"; $res = $db->query($sql); $res->setFetchMode(PDO::FETCH_ASSOC); $count = $res->rowCount(); $data = $res->fetchAll(); die(json_encode($data));
Done!