1. 程式人生 > 其它 >php讀取MySQL獲取分割槽名稱及屬性資訊的查詢語句

php讀取MySQL獲取分割槽名稱及屬性資訊的查詢語句

技術標籤:php

//獲取分割槽名稱及屬性資訊;
$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(); echo "<PRE>"; var_dump($data);

Done!