我知道如何获取表的大小,但如何查询单个表行的大小(以兆字节为单位)?
这里的帖子建议:
$rowLength = 0;
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if(!$result) {
die('Could not run query');
}
$lengths = mysql_fetch_lengths($result);
foreach($lengths as $length) {
$rowLength += $length;
}
echo "\$rowLength = $rowLength";
...但解决方案似乎会累积字段长度值,我需要字节大小(转换为 Mb)。