How get size of blob in PHP or SQL
11,152
In SQL:
SELECT some_key, LENGTH(blob_column) AS size_in_bytes FROM the_table
In PHP:
$sizes = array();
foreach (how_you_query_the_db('SELECT some_key, blob_column FROM the_table ') as $row)
$sizes[$row['some_key']] = strlen($row['blob_column']);
Comments
-
Clément Andraud almost 2 years
I have lots of blob data in my database, and I need to retrieve the weight (400kb, 14,2kb etc.) for each.
How can I do that?